You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

451 lines
18 KiB

  1. cmake_minimum_required (VERSION 3.2)
  2. cmake_policy(VERSION 3.2)
  3. # Set project name
  4. project (storm CXX C)
  5. # Add base folder for better inclusion paths
  6. include_directories("${PROJECT_SOURCE_DIR}/src")
  7. include_directories("${PROJECT_SOURCE_DIR}/src/storm")
  8. # Add the resources/cmake folder to Module Search Path for FindTBB.cmake
  9. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/resources/cmake/find_modules" "${PROJECT_SOURCE_DIR}/resources/cmake/macros")
  10. include(ExternalProject)
  11. include(RegisterSourceGroup)
  12. include(imported)
  13. #############################################################
  14. ##
  15. ## CMake options of Storm
  16. ##
  17. #############################################################
  18. option(STORM_DEVELOPER "Sets whether the development mode is used." OFF)
  19. option(STORM_ALLWARNINGS "Compile with even more warnings" OFF)
  20. option(STORM_USE_LTO "Sets whether link-time optimizations are enabled." ON)
  21. MARK_AS_ADVANCED(STORM_USE_LTO)
  22. option(STORM_PORTABLE "Sets whether a build needs to be portable." OFF)
  23. MARK_AS_ADVANCED(STORM_PORTABLE)
  24. # Force POPCNT is helpful for portable code targetting platforms with SSE4.2 operation support.
  25. option(STORM_FORCE_POPCNT "Sets whether the popcnt instruction is forced to be used (advanced)." OFF)
  26. MARK_AS_ADVANCED(STORM_FORCE_POPCNT)
  27. option(USE_BOOST_STATIC_LIBRARIES "Sets whether the Boost libraries should be linked statically." OFF)
  28. option(STORM_USE_INTELTBB "Sets whether the Intel TBB libraries should be used." OFF)
  29. option(STORM_USE_GUROBI "Sets whether Gurobi should be used." OFF)
  30. set(STORM_CARL_DIR_HINT "" CACHE STRING "A hint where the preferred CArL version can be found. If CArL cannot be found there, it is searched in the OS's default paths.")
  31. 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)
  32. MARK_AS_ADVANCED(STORM_FORCE_SHIPPED_CARL)
  33. option(USE_SMTRAT "Sets whether SMT-RAT should be included." OFF)
  34. option(USE_HYPRO "Sets whether HyPro should be included." OFF)
  35. option(XML_SUPPORT "Sets whether xml based format parsing should be included." ON)
  36. option(FORCE_COLOR "Force color output" OFF)
  37. mark_as_advanced(FORCE_COLOR)
  38. option(STORM_COMPILE_WITH_CCACHE "Compile using CCache [if found]" ON)
  39. mark_as_advanced(STORM_COMPILE_WITH_CCACHE)
  40. option(STORM_LOG_DISABLE_DEBUG "Disable log and trace message support" OFF)
  41. option(STORM_USE_CLN_EA "Sets whether CLN instead of GMP numbers should be used for exact arithmetic." OFF)
  42. export_option(STORM_USE_CLN_EA)
  43. option(STORM_USE_CLN_RF "Sets whether CLN instead of GMP numbers should be used for rational functions." ON)
  44. export_option(STORM_USE_CLN_RF)
  45. option(BUILD_SHARED_LIBS "Build the Storm library dynamically" OFF)
  46. option(STORM_DEBUG_CUDD "Build CUDD in debug mode." OFF)
  47. MARK_AS_ADVANCED(STORM_DEBUG_CUDD)
  48. set(BOOST_ROOT "" CACHE STRING "A hint to the root directory of Boost (optional).")
  49. set(GUROBI_ROOT "" CACHE STRING "A hint to the root directory of Gurobi (optional).")
  50. set(Z3_ROOT "" CACHE STRING "A hint to the root directory of Z3 (optional).")
  51. set(CUDA_ROOT "" CACHE STRING "The hint to the root directory of CUDA (optional).")
  52. set(MSAT_ROOT "" CACHE STRING "The hint to the root directory of MathSAT (optional).")
  53. set(ADDITIONAL_INCLUDE_DIRS "" CACHE STRING "Additional directories added to the include directories.")
  54. set(ADDITIONAL_LINK_DIRS "" CACHE STRING "Additional directories added to the link directories.")
  55. set(USE_XERCESC ${XML_SUPPORT})
  56. mark_as_advanced(USE_XERCESC)
  57. # Set some CMAKE Variables as advanced
  58. mark_as_advanced(CMAKE_OSX_ARCHITECTURES)
  59. mark_as_advanced(CMAKE_OSX_SYSROOT)
  60. mark_as_advanced(CMAKE_OSX_DEPLOYMENT_TARGET)
  61. # Offer the user the choice of overriding the installation directories
  62. set(INCLUDE_INSTALL_DIR include/ CACHE PATH "Installation directory for header files" )
  63. set(LIB_INSTALL_DIR lib/ CACHE PATH "Installation directory for libraries")
  64. #set(SYSCONFIG_INSTALL_DIR etc/carl/ CACHE PATH "Installation for system configuration files)
  65. set(BIN_INSTALL_DIR lib/ CACHE PATH "Installation directory for executables")
  66. # Install dir for cmake files (info for other libraries that include Storm)
  67. set(DEF_INSTALL_CMAKE_DIR "lib/CMake/storm")
  68. set(CMAKE_INSTALL_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files")
  69. message("CMAKE_INSTALL_DIR: ${CMAKE_INSTALL_DIR}")
  70. # If the STORM_DEVELOPER option was turned on, by default we target a debug version, otherwise a release version.
  71. if (STORM_DEVELOPER)
  72. if (NOT CMAKE_BUILD_TYPE)
  73. set(CMAKE_BUILD_TYPE "DEBUG")
  74. endif()
  75. add_definitions(-DSTORM_DEV)
  76. else()
  77. set(STORM_LOG_DISABLE_DEBUG ON)
  78. if (NOT CMAKE_BUILD_TYPE)
  79. set(CMAKE_BUILD_TYPE "RELEASE")
  80. endif()
  81. endif()
  82. message(STATUS "Storm - Building ${CMAKE_BUILD_TYPE} version.")
  83. if(STORM_COMPILE_WITH_CCACHE)
  84. find_program(CCACHE_FOUND ccache)
  85. mark_as_advanced(CCACHE_FOUND)
  86. if(CCACHE_FOUND)
  87. message(STATUS "Storm - Using ccache")
  88. set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
  89. set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
  90. else()
  91. message(STATUS "Storm - Could not find ccache.")
  92. endif()
  93. endif()
  94. # Directory for test resources.
  95. set(STORM_TEST_RESOURCES_DIR "${PROJECT_SOURCE_DIR}/resources/examples/testfiles")
  96. # Auto-detect operating system.
  97. set(MACOSX 0)
  98. set(LINUX 0)
  99. if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
  100. # Mac OS
  101. set(OPERATING_SYSTEM "Mac OS")
  102. set(MACOSX 1)
  103. elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
  104. # Linux
  105. set(OPERATING_SYSTEM "Linux")
  106. set(LINUX 1)
  107. elseif(WIN32)
  108. # Assuming Windows.
  109. set(OPERATING_SYSTEM "Windows")
  110. else()
  111. message(WARNING "We are unsure about your operating system.")
  112. set(OPERATING_SYSTEM "Linux")
  113. set(LINUX 1)
  114. ENDIF()
  115. message(STATUS "Storm - Detected operating system ${OPERATING_SYSTEM}.")
  116. set(DYNAMIC_EXT ".so")
  117. set(STATIC_EXT ".a")
  118. set(LIB_PREFIX "lib")
  119. if(MACOSX)
  120. set(DYNAMIC_EXT ".dylib")
  121. set(STATIC_EXT ".a")
  122. set(LIB_PREFIX "lib")
  123. elseif (WIN32)
  124. set(DYNAMIC_EXT ".dll")
  125. set(STATIC_EXT ".lib")
  126. set(LIB_PREFIX "")
  127. endif()
  128. message(STATUS "Assuming extension for shared libraries: ${DYNAMIC_EXT}")
  129. message(STATUS "Assuming extension for static libraries: ${STATIC_EXT}")
  130. if(BUILD_SHARED_LIBS)
  131. set(LIB_EXT ${DYNAMIC_EXT})
  132. message(STATUS "Build dynamic libraries.")
  133. else()
  134. set(LIB_EXT ${STATIC_EXT})
  135. message(STATUS "Build static libraries.")
  136. endif()
  137. #############################################################
  138. ##
  139. ## Compiler detection and initial configuration
  140. ##
  141. #############################################################
  142. if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
  143. # using Clang
  144. if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.2)
  145. message(FATAL_ERROR "Clang version must be at least 3.2.")
  146. endif()
  147. set(STORM_COMPILER_CLANG ON)
  148. set(CLANG ON)
  149. set(STORM_COMPILER_ID "clang")
  150. elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
  151. # using AppleClang
  152. if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3)
  153. message(FATAL_ERROR "AppleClang version must be at least 7.3.")
  154. endif()
  155. set(STORM_COMPILER_APPLECLANG ON)
  156. set(CLANG ON)
  157. set(STORM_COMPILER_ID "AppleClang")
  158. set(CMAKE_MACOSX_RPATH ON)
  159. elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
  160. # using GCC
  161. if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
  162. message(FATAL_ERROR "gcc version must be at least 5.0.")
  163. endif()
  164. set(STORM_COMPILER_GCC ON)
  165. set(STORM_COMPILER_ID "gcc")
  166. elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
  167. message(FATAL_ERROR "Intel compiler is currently not supported.")
  168. elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
  169. message(FATAL_ERROR "Visual Studio compiler is currently not supported.")
  170. endif()
  171. set(STORM_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION})
  172. if(CCACHE_FOUND)
  173. set(STORM_COMPILER_ID "${STORM_COMPILER_ID} (ccache)")
  174. endif()
  175. #############################################################
  176. ##
  177. ## Compiler independent settings
  178. ##
  179. #############################################################
  180. if (STORM_FORCE_POPCNT)
  181. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcnt")
  182. endif()
  183. # TODO: remove forcing the old version of optional as soon as the related Spirit bug is fixed:
  184. # https://svn.boost.org/trac/boost/ticket/12349
  185. # Fix thanks to: https://github.com/freeorion/freeorion/issues/777
  186. add_definitions(-DBOOST_RESULT_OF_USE_DECLTYPE -DBOOST_OPTIONAL_CONFIG_USE_OLD_IMPLEMENTATION_OF_OPTIONAL)
  187. #############################################################
  188. ##
  189. ## Compiler specific settings
  190. ##
  191. #############################################################
  192. if (STORM_COMPILER_CLANG OR STORM_COMPILER_APPLECLANG)
  193. if(FORCE_COLOR)
  194. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
  195. endif()
  196. if (LINUX)
  197. set(CLANG_STDLIB libstdc++)
  198. else()
  199. set(CLANG_STDLIB libc++)
  200. endif()
  201. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -stdlib=${CLANG_STDLIB} -ftemplate-depth=1024")
  202. set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffast-math -fno-finite-math-only")
  203. if(LINUX)
  204. set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -rdynamic")
  205. set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")
  206. elseif(MACOSX)
  207. set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-export_dynamic")
  208. set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-export_dynamic")
  209. endif()
  210. elseif (STORM_COMPILER_GCC)
  211. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
  212. set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fprefetch-loop-arrays -ffast-math -fno-finite-math-only")
  213. set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -rdynamic")
  214. set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")
  215. endif ()
  216. if (STORM_USE_LTO)
  217. set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto")
  218. # Fix for problems that occurred when using LTO on gcc. This should be removed when it
  219. # is not needed anymore as it makes the the already long link-step potentially longer.
  220. if (STORM_COMPILER_GCC)
  221. set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto-partition=none")
  222. endif()
  223. message(STATUS "Storm - Enabling link-time optimizations.")
  224. else()
  225. message(STATUS "Storm - Disabling link-time optimizations.")
  226. endif()
  227. # In release mode, we turn on even more optimizations if we do not have to provide a portable binary.
  228. if (NOT STORM_PORTABLE)
  229. set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -march=native")
  230. endif ()
  231. if (STORM_DEVELOPER)
  232. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
  233. if (STORM_ALLWARNINGS)
  234. if (CLANG)
  235. # Enable strictly every warning and then disable selected ones.
  236. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything")
  237. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++98-compat -Wno-c++98-compat-pedantic")
  238. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-old-style-cast")
  239. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-reserved-id-macro")
  240. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-newline-eof")
  241. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-documentation")
  242. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-weak-vtables")
  243. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-global-constructors")
  244. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-exit-time-destructors")
  245. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch-enum")
  246. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-covered-switch-default")
  247. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-padded")
  248. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-float-equal")
  249. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedef")
  250. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-variable-declarations")
  251. endif ()
  252. else ()
  253. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
  254. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas")
  255. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs")
  256. endif ()
  257. else()
  258. set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer")
  259. endif()
  260. #############################################################
  261. ##
  262. ## RPATH settings
  263. ##
  264. #############################################################
  265. # don't skip the full RPATH for the build tree
  266. SET(CMAKE_SKIP_BUILD_RPATH FALSE)
  267. # when building, don't use the install RPATH already (but only when installing)
  268. SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
  269. # the RPATH to be used when installing
  270. SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
  271. # don't add the automatically determined parts of the RPATH
  272. # which point to directories outside the build tree to the install RPATH
  273. SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
  274. #############################################################
  275. ##
  276. ## Generator specific settings
  277. ##
  278. #############################################################
  279. if ("${CMAKE_GENERATOR}" STREQUAL "Xcode")
  280. set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14")
  281. set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
  282. endif()
  283. # Display information about build configuration.
  284. message(STATUS "Storm - Using compiler configuration ${STORM_COMPILER_ID} ${STORM_COMPILER_VERSION}.")
  285. if (STORM_DEVELOPER)
  286. message(STATUS "Storm - CXX Flags: ${CMAKE_CXX_FLAGS}")
  287. message(STATUS "Storm - CXX Debug Flags: ${CMAKE_CXX_FLAGS_DEBUG}")
  288. message(STATUS "Storm - CXX Release Flags: ${CMAKE_CXX_FLAGS_RELEASE}")
  289. message(STATUS "Storm - Build type: ${CMAKE_BUILD_TYPE}")
  290. endif()
  291. #############################################################
  292. #############################################################
  293. ##
  294. ## Inclusion of required libraries
  295. ##
  296. #############################################################
  297. #############################################################
  298. #############################################################
  299. ##
  300. ## Include the targets for non-system resources
  301. ##
  302. #############################################################
  303. # In 3rdparty, targets are being defined that can be used
  304. # in the the system does not have a library
  305. include(resources/3rdparty/CMakeLists.txt)
  306. #############################################################
  307. ##
  308. ## Doxygen
  309. ##
  310. #############################################################
  311. find_package(Doxygen)
  312. # Add a target to generate API documentation with Doxygen
  313. if(DOXYGEN_FOUND)
  314. set(CMAKE_DOXYGEN_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/doc")
  315. string(REGEX REPLACE ";" " " CMAKE_DOXYGEN_INPUT_LIST "${PROJECT_SOURCE_DIR}/src")
  316. configure_file("${CMAKE_CURRENT_SOURCE_DIR}/resources/doxygen/Doxyfile.in" "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" @ONLY)
  317. add_custom_target(doc ${DOXYGEN_EXECUTABLE} "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" COMMENT "Generating API documentation with Doxygen" VERBATIM)
  318. endif(DOXYGEN_FOUND)
  319. #############################################################
  320. ##
  321. ## CMake-generated Config File for Storm
  322. ##
  323. #############################################################
  324. # try to obtain the current version from git.
  325. include(GetGitRevisionDescription)
  326. get_git_head_revision(STORM_VERSION_REFSPEC STORM_VERSION_GIT_HASH)
  327. git_describe_checkout(STORM_GIT_VERSION_STRING)
  328. # parse the git tag into variables
  329. string(REGEX REPLACE "^([0-9]+)\\..*" "\\1" STORM_VERSION_MAJOR "${STORM_GIT_VERSION_STRING}")
  330. string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" STORM_VERSION_MINOR "${STORM_GIT_VERSION_STRING}")
  331. string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" STORM_VERSION_PATCH "${STORM_GIT_VERSION_STRING}")
  332. string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-([0-9]+)\\-.*" "\\1" STORM_VERSION_COMMITS_AHEAD "${STORM_GIT_VERSION_STRING}")
  333. string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-[0-9]+\\-([a-z0-9]+).*" "\\1" STORM_VERSION_TAG_HASH "${STORM_GIT_VERSION_STRING}")
  334. string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-[0-9]+\\-[a-z0-9]+\\-(.*)" "\\1" STORM_VERSION_APPENDIX "${STORM_GIT_VERSION_STRING}")
  335. # now check whether the git version lookup failed
  336. if (STORM_VERSION_MAJOR MATCHES "NOTFOUND")
  337. include(version.cmake)
  338. set(STORM_VERSION_GIT_HASH "")
  339. set(STORM_VERSION_COMMITS_AHEAD 0)
  340. set(STORM_VERSION_DIRTY boost::none)
  341. message(WARNING "Storm - git version information not available, statically assuming version ${STORM_VERSION_MAJOR}.${STORM_VERSION_MINOR}.${STORM_VERSION_PATCH}.")
  342. else()
  343. if ("${STORM_VERSION_APPENDIX}" MATCHES "^.*dirty.*$")
  344. set(STORM_VERSION_DIRTY "true")
  345. else()
  346. set(STORM_VERSION_DIRTY "false")
  347. endif()
  348. endif()
  349. set(STORM_VERSION_DEV "false")
  350. set(STORM_VERSION_DEV_STRING "")
  351. if(STORM_VERSION_COMMITS_AHEAD)
  352. MATH(EXPR STORM_VERSION_DEV_PATCH "${STORM_VERSION_PATCH}+1")
  353. set(STORM_VERSION_DEV "true")
  354. set(STORM_VERSION_DEV_STRING " (dev)")
  355. else()
  356. set(STORM_VERSION_DEV_PATCH ${STORM_VERSION_PATCH})
  357. endif()
  358. set(STORM_VERSION "${STORM_VERSION_MAJOR}.${STORM_VERSION_MINOR}.${STORM_VERSION_DEV_PATCH}")
  359. set(STORM_VERSION_STRING "${STORM_VERSION}${STORM_VERSION_DEV_STRING}")
  360. message(STATUS "Storm - version is ${STORM_VERSION_STRING} (version ${STORM_VERSION_MAJOR}.${STORM_VERSION_MINOR}.${STORM_VERSION_PATCH} + ${STORM_VERSION_COMMITS_AHEAD} commits), building from git: ${STORM_VERSION_GIT_HASH} (dirty: ${STORM_VERSION_DIRTY}).")
  361. # Configure a header file to pass some of the CMake settings to the source code
  362. configure_file (
  363. "${PROJECT_SOURCE_DIR}/storm-config.h.in"
  364. "${PROJECT_BINARY_DIR}/include/storm-config.h"
  365. )
  366. # Configure a source file to pass the Storm version to the source code
  367. configure_file (
  368. "${PROJECT_SOURCE_DIR}/storm-version.cpp.in"
  369. "${PROJECT_SOURCE_DIR}/src/storm/utility/storm-version.cpp"
  370. )
  371. set(STORM_GENERATED_SOURCES "${PROJECT_BINARY_DIR}/src/storm/utility/storm-version.cpp")
  372. # Add the binary dir include directory for storm-config.h
  373. include_directories("${PROJECT_BINARY_DIR}/include")
  374. include(CTest)
  375. # Compiles all tests
  376. add_custom_target(tests)
  377. # Compiles and runs all tests
  378. add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
  379. set(CMAKE_CTEST_COMMAND_VERBOSE ${CMAKE_CTEST_COMMAND} -V)
  380. add_custom_target(check-verbose COMMAND ${CMAKE_CTEST_COMMAND_VERBOSE})
  381. add_dependencies(check tests)
  382. add_dependencies(check-verbose tests)
  383. set(STORM_TARGETS "")
  384. add_subdirectory(src)
  385. include(export)
  386. include(StormCPackConfig.cmake)