diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e76a3129..edf817f5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,8 @@ option(USE_BOOST_STATIC_LIBRARIES "Sets whether the Boost libraries should be li option(STORM_USE_INTELTBB "Sets whether the Intel TBB libraries should be used." OFF) option(STORM_USE_GUROBI "Sets whether Gurobi should be used." OFF) option(USE_CARL "Sets whether carl should be included." ON) +option(STORM_FORCE_SHIPPED_CARL "Sets whether the shipped version of carl is to be used no matter whether carl is found or not." OFF) +MARK_AS_ADVANCED(STORM_FORCE_SHIPPED_CARL) option(USE_SMTRAT "Sets whether SMT-RAT should be included." OFF) option(USE_HYPRO "Sets whether HyPro should be included." OFF) option(XML_SUPPORT "Sets whether xml based format parsing should be included." ON) @@ -266,6 +268,25 @@ else() set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer") endif() +############################################################# +## +## RPATH settings +## +############################################################# + +# don't skip the full RPATH for the build tree +SET(CMAKE_SKIP_BUILD_RPATH FALSE) + +# when building, don't use the install RPATH already (but only when installing) +SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) + +# the RPATH to be used when installing +SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + +# don't add the automatically determined parts of the RPATH +# which point to directories outside the build tree to the install RPATH +SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + ############################################################# ## ## Generator specific settings diff --git a/resources/3rdparty/CMakeLists.txt b/resources/3rdparty/CMakeLists.txt index 4077d6230..32cf3872e 100644 --- a/resources/3rdparty/CMakeLists.txt +++ b/resources/3rdparty/CMakeLists.txt @@ -178,8 +178,6 @@ include(${STORM_3RDPARTY_SOURCE_DIR}/include_cudd.cmake) ############################################################# include(${STORM_3RDPARTY_SOURCE_DIR}/include_cpptemplate.cmake) - - ############################################################# ## ## carl @@ -188,25 +186,25 @@ include(${STORM_3RDPARTY_SOURCE_DIR}/include_cpptemplate.cmake) set(STORM_HAVE_CARL OFF) if(USE_CARL) - find_package(carl QUIET) - if(carl_FOUND) - set(STORM_SHIPPED_CARL OFF) + if (NOT STORM_FORCE_SHIPPED_CARL) + find_package(carl QUIET) + endif() + if(carl_FOUND AND NOT STORM_FORCE_SHIPPED_CARL) + set(STORM_SHIPPED_CARL OFF) set(STORM_HAVE_CARL ON) message(STATUS "Storm - Use system version of carl.") message(STATUS "Storm - Linking with carl ${carl_VERSION} (CARL_USE_CLN_NUMBERS: ${CARL_USE_CLN_NUMBERS}).") set(STORM_HAVE_CLN ${CARL_USE_CLN_NUMBERS}) else() - set(STORM_SHIPPED_CARL ON) + set(STORM_SHIPPED_CARL ON) # The first external project will be built at *configure stage* message("START CARL CONFIG PROCESS") file(MAKE_DIRECTORY ${STORM_3RDPARTY_BINARY_DIR}/carl_download) - execute_process( - COMMAND ${CMAKE_COMMAND} ${STORM_3RDPARTY_SOURCE_DIR}/carl "-DSTORM_3RDPARTY_BINARY_DIR=${STORM_3RDPARTY_BINARY_DIR}" - WORKING_DIRECTORY ${STORM_3RDPARTY_BINARY_DIR}/carl_download - OUTPUT_VARIABLE carlconfig_out - RESULT_VARIABLE carlconfig_result - ) - + execute_process( + COMMAND ${CMAKE_COMMAND} ${STORM_3RDPARTY_SOURCE_DIR}/carl "-DSTORM_3RDPARTY_BINARY_DIR=${STORM_3RDPARTY_BINARY_DIR}" + WORKING_DIRECTORY ${STORM_3RDPARTY_BINARY_DIR}/carl_download + OUTPUT_VARIABLE carlconfig_out + RESULT_VARIABLE carlconfig_result) if(NOT carlconfig_result) message("${carlconfig_out}") @@ -237,17 +235,20 @@ if(USE_CARL) include(${STORM_3RDPARTY_BINARY_DIR}/carl/carlConfig.cmake) message("CARL_USE_CLN_NUMBERS: ${CARL_USE_CLN_NUMBERS}") set(STORM_HAVE_CLN ${CARL_USE_CLN_NUMBERS}) - add_dependencies(resources carl) + add_dependencies(resources carl) set(carl_INCLUDE_DIR "${STORM_3RDPARTY_BINARY_DIR}/carl/include/") - set(carl_LIBRARIES ${STORM_3RDPARTY_BINARY_DIR}/carl/lib/libcarl${DYNAMIC_EXT}) + set(carl_LIBRARIES ${STORM_3RDPARTY_BINARY_DIR}/carl/lib/libcarl${DYNAMIC_EXT}) set(STORM_HAVE_CARL ON) + + # install the carl dynamic library if we build it + get_filename_component(STORM_CARL_DYLIB_FULL_PATH ${STORM_3RDPARTY_BINARY_DIR}/carl/lib/libcarl${DYNAMIC_EXT} REALPATH) + install(FILES ${STORM_CARL_DYLIB_FULL_PATH} DESTINATION lib) endif() if(STORM_USE_CLN_NUMBERS AND NOT STORM_HAVE_CLN) message(FATAL_ERROR "Cannot use CLN numbers if carl is build without") endif() list(APPEND STORM_DEP_IMP_TARGETS lib_carl) - endif() diff --git a/src/storm/CMakeLists.txt b/src/storm/CMakeLists.txt index 363fbc0ab..d9135dcb9 100644 --- a/src/storm/CMakeLists.txt +++ b/src/storm/CMakeLists.txt @@ -51,7 +51,6 @@ add_executable(storm-main ${STORM_MAIN_SOURCES} ${STORM_MAIN_HEADERS}) target_link_libraries(storm-main storm) set_target_properties(storm-main PROPERTIES OUTPUT_NAME "storm") - # Install storm headers to include directory. foreach(HEADER ${STORM_LIB_HEADERS}) string(REGEX REPLACE "${PROJECT_SOURCE_DIR}/src/?" "" RELATIVE_HEADER_PATH ${HEADER}) @@ -69,3 +68,5 @@ add_custom_target(copy_storm_headers DEPENDS ${STORM_OUTPUT_HEADERS} ${STORM_LIB add_dependencies(storm copy_storm_headers) add_dependencies(storm copy_resources_headers) +# install command +install(TARGETS storm-main storm RUNTIME DESTINATION bin LIBRARY DESTINATION lib OPTIONAL) \ No newline at end of file