Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,13 @@ mark_as_advanced(CMAKE_OSX_SYSROOT)
mark_as_advanced(CMAKE_OSX_DEPLOYMENT_TARGET)

# Offer the user the choice of overriding the installation directories
set(STORM_INCLUDE_INSTALL_DIR include/storm CACHE PATH "Installation directory for header files" )
set(STORM_LIB_INSTALL_DIR lib/storm CACHE PATH "Installation directory for libraries")
set(STORM_BIN_INSTALL_DIR bin/storm CACHE PATH "Installation directory for executables")
set(STORM_CMAKE_INSTALL_DIR lib/cmake/storm CACHE PATH "Installation directory for CMake files")
set(STORM_RESOURCE_INCLUDE_INSTALL_DIR include/storm/resources/ CACHE PATH "Installation directory for dependency header files")
set(STORM_RESOURCE_LIBRARY_INSTALL_DIR lib/storm/resources/ CACHE PATH "Installation directory for dependency library files")
include(GNUInstallDirs)
set(STORM_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}/storm CACHE PATH "Installation directory for header files" )
set(STORM_LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR} CACHE PATH "Installation directory for libraries")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change the default? For custom-built paths (vs packages) the old default seems to make it easier to cleanup?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CMake variables CMAKE_INSTALL_INCUDEDIR etc. can also be set from cmake or ccmake. So this makes it a bit more configurable in my view instead of using fixed paths as default. I thought using the standard locations provided by GnuInstallDirs would make it better align with the standard behavior of others.

set(STORM_BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR} CACHE PATH "Installation directory for executables")
set(STORM_CMAKE_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/storm CACHE PATH "Installation directory for CMake files")
set(STORM_RESOURCE_INCLUDE_INSTALL_DIR ${STORM_INCLUDE_INSTALL_DIR}/resources CACHE PATH "Installation directory for dependency header files")
set(STORM_RESOURCE_LIBRARY_INSTALL_DIR ${STORM_LIB_INSTALL_DIR} CACHE PATH "Installation directory for dependency library files")
if(PROJECT_IS_TOP_LEVEL)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
Expand Down
33 changes: 20 additions & 13 deletions resources/3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ if(PROJECT_TOP_LEVEL)
endif()
add_custom_target(test-resources)

include(FetchContent)

message(STATUS "Storm - Building external resources with ${STORM_RESOURCES_BUILD_JOBCOUNT} job(s) in parallel.")

Expand Down Expand Up @@ -190,11 +191,11 @@ if(${Boost_VERSION} VERSION_LESS "1.75.0") # Debian 12 ships with Boost 1.74.0
add_dependencies(boost_pfr boost_pfr_src)
target_include_directories(boost_pfr INTERFACE
$<BUILD_INTERFACE:${STORM_3RDPARTY_BINARY_DIR}/boost_pfr/include>
$<INSTALL_INTERFACE:${STORM_RESOURCE_INCLUDE_INSTALL_DIR}/boost_pfr/include>
$<INSTALL_INTERFACE:${STORM_RESOURCE_INCLUDE_INSTALL_DIR}/boost_pfr>
)
install(TARGETS boost_pfr EXPORT storm_Targets)
install(DIRECTORY ${STORM_3RDPARTY_BINARY_DIR}/boost_pfr/include/
DESTINATION ${STORM_RESOURCE_INCLUDE_INSTALL_DIR}/boost_pfr/include
DESTINATION ${STORM_RESOURCE_INCLUDE_INSTALL_DIR}/boost_pfr
PATTERN ".git" EXCLUDE)
add_dependencies(storm_resources boost_pfr)
list(APPEND STORM_DEP_TARGETS boost_pfr)
Expand Down Expand Up @@ -253,7 +254,7 @@ list(APPEND STORM_DEP_TARGETS phmap)
# Use the shipped version of cpphoafparser
message(STATUS "Storm - Including cpphoafparser 0.99.2")
set(cppHOAparser_SOURCE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/cpphoafparser-0.99.2/include)
set(cppHOAparser_INSTALL_DIR ${STORM_RESOURCE_INCLUDE_INSTALL_DIR}/cpphoafparser-0.99.2/)
set(cppHOAparser_INSTALL_DIR ${STORM_RESOURCE_INCLUDE_INSTALL_DIR}/cpphoafparser/)
add_library(cppHOAparser INTERFACE) # Not imported, we are in control of the sources.
target_include_directories(cppHOAparser INTERFACE
$<BUILD_INTERFACE:${cppHOAparser_SOURCE_DIR}>
Expand Down Expand Up @@ -425,7 +426,8 @@ endif()
## carl (including cln and ginac)
##
#############################################################
# Set compile flags for dependencies

# Set CLN/GiNaC configuration
if(STORM_USE_CLN_EA OR STORM_USE_CLN_RF)
set(SHIPPED_CARL_USE_CLN_NUMBERS ON)
set(SHIPPED_CARL_USE_GINAC ON)
Expand All @@ -434,25 +436,30 @@ else()
set(SHIPPED_CARL_USE_GINAC OFF)
endif()

include(FetchContent)
# Fetch carl
FETCHCONTENT_DECLARE(
carl
GIT_REPOSITORY ${STORM_CARL_GIT_REPO}
GIT_TAG ${STORM_CARL_GIT_TAG}
carl
GIT_REPOSITORY ${STORM_CARL_GIT_REPO}
GIT_TAG ${STORM_CARL_GIT_TAG}
)

# Configure carl
SET(CARL_EXCLUDE_TESTS_FROM_ALL ON) #carl without tests
SET(CARL_THREAD_SAFE ON) #carl thread safe code
SET(CARL_USE_CLN_NUMBERS ${SHIPPED_CARL_USE_CLN_NUMBERS})
SET(CARL_USE_GINAC ${SHIPPED_CARL_USE_GINAC})
SET(CARL_EIGEN_GIT_TAG ${STORM_EIGEN_GIT_TAG})
SET(CARL_PORTABLE ${STORM_PORTABLE})
SET(CARL_LIB_INSTALL_DIR "lib/storm/resources")
SET(CARL_INCLUDE_INSTALL_DIR "include/storm/resources") # maybe use resources folder /carl instead for consistency?
SET(CARL_EXPORT_TO_CMAKE OFF)
SET(CARL_CMAKE_INSTALL_DIR "lib/cmake/storm")

# Override carl's install dirs to match system conventions
SET(CARL_LIB_INSTALL_DIR ${STORM_RESOURCE_LIBRARY_INSTALL_DIR})
SET(CARL_INCLUDE_INSTALL_DIR ${STORM_RESOURCE_INCLUDE_INSTALL_DIR}/carl)
SET(CARL_CMAKE_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/carl)

FETCHCONTENT_MAKEAVAILABLE(carl)
include(${carl_BINARY_DIR}/carlConfig.cmake)

# Read variables from this config.
set(STORM_HAVE_CLN ${CARL_HAVE_CLN})
set(STORM_HAVE_GINAC ${CARL_HAVE_GINAC})
Expand Down Expand Up @@ -607,8 +614,8 @@ if(NOT STORM_DISABLE_SYLVAN)
SET(SYLVAN_GMP ON)
SET(USE_CARL ON)
set(SYLVAN_PORTABLE ${STORM_PORTABLE})
SET(SYLVAN_INSTALL_BINDIR ${STORM_RESOURCE_BIN_INSTALL_DIR}/sylvan)
SET(SYLVAN_INSTALL_LIBDIR ${STORM_RESOURCE_LIBRARY_INSTALL_DIR}/sylvan)
SET(SYLVAN_INSTALL_BINDIR ${STORM_RESOURCE_BIN_INSTALL_DIR})
SET(SYLVAN_INSTALL_LIBDIR ${STORM_RESOURCE_LIBRARY_INSTALL_DIR})
SET(SYLVAN_INSTALL_INCLUDEDIR ${STORM_RESOURCE_INCLUDE_INSTALL_DIR}/sylvan)
SET(CMAKE_POSITION_INDEPENDENT_CODE ON) # Likely only necessary on linux
SET(STORM_SOURCE_DIR "${PROJECT_SOURCE_DIR}/src/") # TODO this is ugly.
Expand Down
4 changes: 2 additions & 2 deletions resources/3rdparty/include_cudd.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ ExternalProject_Add(
LOG_BUILD ON
LOG_INSTALL ON
BUILD_BYPRODUCTS ${CUDD_LIB_DIR}/libcudd${STATIC_EXT}
LOG_OUTPUT_ON_FAILURE ON
LOG_OUTPUT_ON_FAILURE ON
)

# Do not use system CUDD, StoRM has a modified version
# Do not use system CUDD, Storm has a modified version
set(CUDD_INCLUDE_DIR ${STORM_3RDPARTY_BINARY_DIR}/cudd-3.0.0/include)
set(CUDD_STATIC_LIBRARY ${CUDD_LIB_DIR}/libcudd${STATIC_EXT})
set(CUDD_VERSION_STRING 3.0.0)
Expand Down
8 changes: 4 additions & 4 deletions resources/cmake/stormConfig.cmake.install.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ endif()
set(STORM_RESOURCE_INCLUDE_INSTALL_DIR "${_IMPORT_PREFIX}/@STORM_RESOURCE_INCLUDE_INSTALL_DIR@")
set(STORM_RESOURCE_LIBRARY_INSTALL_DIR "${_IMPORT_PREFIX}/@STORM_RESOURCE_LIBRARY_INSTALL_DIR@")

include("${CMAKE_CURRENT_LIST_DIR}/carlConfig.cmake")
include("${STORM_RESOURCE_LIBRARY_INSTALL_DIR}/cmake/carl/carlConfig.cmake")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about replacing ${CMAKE_CURRENT_LIST_DIR} by ${STORM_RESOURCE_LIBRARY_INSTALL_DIR}/cmake What is the motivation for that (I understand the carl/ part?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the new changes, the carlConfig will be in a directory next to the Storm repository and not a sub-directory anymore. So we would need to go up one directory. But I guess we could still use "${CMAKE_CURRENT_LIST_DIR}/../carl/carlConfig.cmake".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so I dislike a bit that carl will be installed on the same level as storm, but if we do it that way, I understand the use of absolute paths.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, then I will keeps it as is for now.
I will check whether putting carl a level deeper would also work.

if(NOT TARGET lib_carl)
message(FATAL_ERROR "Including ${CMAKE_CURRENT_LIST_DIR}/carlConfig.cmake did not define target lib_carl.")
message(FATAL_ERROR "Including ${STORM_RESOURCE_LIBRARY_INSTALL_DIR}/cmake/carl/carlConfig.cmake did not define target lib_carl.")
endif()
set(storm_carl_DIR "${CMAKE_CURRENT_LIST_DIR}")
set(storm_carl_DIR "${STORM_RESOURCE_LIBRARY_INSTALL_DIR}/cmake/carl")

set(CMAKE_MODULE_PATH_save "${CMAKE_MODULE_PATH}")
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_LIST_DIR}/find_modules/")
Expand Down Expand Up @@ -112,7 +112,7 @@ if(@STORM_HAVE_SPOT@) # STORM_HAVE_SPOT
endif()

if(@STORM_HAVE_SYLVAN@) # STORM_HAVE_SYLVAN
include("${STORM_RESOURCE_LIBRARY_INSTALL_DIR}/sylvan/cmake/sylvan/sylvan-config.cmake")
include("${STORM_RESOURCE_LIBRARY_INSTALL_DIR}/cmake/sylvan/sylvan-config.cmake")
endif()

if(@STORM_HAVE_XERCES@) # STORM_HAVE_XERCES
Expand Down
6 changes: 4 additions & 2 deletions src/storm-cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ target_precompile_headers(storm-cli PRIVATE ${STORM_PRECOMPILED_HEADERS})
add_dependencies(binaries storm-cli)

# installation
install(TARGETS storm-cli EXPORT storm_Targets
RUNTIME DESTINATION bin LIBRARY DESTINATION lib OPTIONAL)
install(TARGETS storm-cli
EXPORT storm_Targets
RUNTIME DESTINATION ${STORM_BIN_INSTALL_DIR}
)
5 changes: 4 additions & 1 deletion src/storm-conv-cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ target_precompile_headers(storm-conv-cli REUSE_FROM storm-cli)
add_dependencies(binaries storm-conv-cli)

# installation
install(TARGETS storm-conv-cli EXPORT storm_Targets RUNTIME DESTINATION bin LIBRARY DESTINATION lib OPTIONAL)
install(TARGETS storm-conv-cli
EXPORT storm_Targets
RUNTIME DESTINATION ${STORM_BIN_INSTALL_DIR}
)
5 changes: 4 additions & 1 deletion src/storm-dft-cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ target_precompile_headers(storm-dft-cli REUSE_FROM storm-cli)
add_dependencies(binaries storm-dft-cli)

# installation
install(TARGETS storm-dft-cli EXPORT storm_Targets RUNTIME DESTINATION bin LIBRARY DESTINATION lib OPTIONAL)
install(TARGETS storm-dft-cli
EXPORT storm_Targets
RUNTIME DESTINATION ${STORM_BIN_INSTALL_DIR}
)
5 changes: 4 additions & 1 deletion src/storm-gspn-cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ target_precompile_headers(storm-gspn-cli REUSE_FROM storm-cli)
add_dependencies(binaries storm-gspn-cli)

# installation
install(TARGETS storm-gspn-cli EXPORT storm_Targets RUNTIME DESTINATION bin LIBRARY DESTINATION lib OPTIONAL)
install(TARGETS storm-gspn-cli
EXPORT storm_Targets
RUNTIME DESTINATION ${STORM_BIN_INSTALL_DIR}
)
5 changes: 4 additions & 1 deletion src/storm-pars-cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ target_precompile_headers(storm-pars-cli REUSE_FROM storm-cli)
add_dependencies(binaries storm-pars-cli)

# installation
install(TARGETS storm-pars-cli EXPORT storm_Targets RUNTIME DESTINATION bin LIBRARY DESTINATION lib OPTIONAL)
install(TARGETS storm-pars-cli
EXPORT storm_Targets
RUNTIME DESTINATION ${STORM_BIN_INSTALL_DIR}
)
5 changes: 4 additions & 1 deletion src/storm-pomdp-cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ set_target_properties(storm-pomdp-cli PROPERTIES VERSION ${STORM_VERSION} SOVERS
add_dependencies(binaries storm-pomdp-cli)

# installation
install(TARGETS storm-pomdp-cli RUNTIME DESTINATION bin LIBRARY DESTINATION lib OPTIONAL)
install(TARGETS storm-pomdp-cli
EXPORT storm_Targets
RUNTIME DESTINATION ${STORM_BIN_INSTALL_DIR}
)
Loading