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.

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