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.

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