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.

549 lines
24 KiB

  1. cmake_minimum_required (VERSION 2.8.6)
  2. # Set project name
  3. project (storm CXX C)
  4. # Add base folder for better inclusion paths
  5. include_directories("${PROJECT_SOURCE_DIR}")
  6. include_directories("${PROJECT_SOURCE_DIR}/src")
  7. # Add the version of Eigen3 in the repository to the include pathes
  8. set(EIGEN3_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/resources/3rdparty/eigen")
  9. include_directories(${EIGEN3_INCLUDE_DIR})
  10. # Add the version of GMM in the repository to the include pathes
  11. set(GMMXX_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/resources/3rdparty/gmm-4.2/include")
  12. include_directories(${GMMXX_INCLUDE_DIR})
  13. #############################################################
  14. ##
  15. ## CMake options of StoRM
  16. ##
  17. #############################################################
  18. option(STORM_DEBUG "Sets whether the DEBUG mode is used" ON)
  19. option(STORM_USE_POPCNT "Sets whether the popcnt instruction is going to be used." ON)
  20. option(USE_BOOST_STATIC_LIBRARIES "Sets whether the Boost libraries should be linked statically." ON)
  21. option(STORM_USE_INTELTBB "Sets whether the Intel TBB libraries should be used." OFF)
  22. option(STORM_USE_COTIRE "Sets whether Cotire should be used (for building precompiled headers)." OFF)
  23. option(LINK_LIBCXXABI "Sets whether libc++abi should be linked." OFF)
  24. option(USE_LIBCXX "Sets whether the standard library is libc++." OFF)
  25. set(GUROBI_ROOT "" CACHE STRING "The root directory of Gurobi (if available).")
  26. set(Z3_ROOT "" CACHE STRING "The root directory of Z3 (if available).")
  27. set(ADDITIONAL_INCLUDE_DIRS "" CACHE STRING "Additional directories added to the include directories.")
  28. set(ADDITIONAL_LINK_DIRS "" CACHE STRING "Additional directories added to the link directories.")
  29. set(CUSTOM_BOOST_ROOT "" CACHE STRING "A custom path to the Boost root directory.")
  30. option(PARAMETRIC_SYSTEMS "Sets whether models with parameters are supported." ON)
  31. #############################################################
  32. ##
  33. ## Inclusion of required libraries
  34. ##
  35. #############################################################
  36. # Add the resources/cmake folder to Module Search Path for FindTBB.cmake
  37. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/resources/cmake/")
  38. # Boost Option variables
  39. set(Boost_USE_STATIC_LIBS ON)
  40. set(Boost_USE_MULTITHREADED ON)
  41. set(Boost_USE_STATIC_RUNTIME OFF)
  42. # If a custom boost root directory was specified, we set the corresponding hint for the script to find it.
  43. if(CUSTOM_BOOST_ROOT)
  44. message(STATUS "StoRM - Using Boost from CUSTOM_BOOST_ROOT located at ${CUSTOM_BOOST_ROOT}")
  45. set(BOOST_ROOT "${CUSTOM_BOOST_ROOT}")
  46. endif(CUSTOM_BOOST_ROOT)
  47. set(TBB_INSTALL_DIR "${PROJECT_SOURCE_DIR}/resources/3rdparty/tbb42_20140122_merged-win-lin-mac")
  48. find_package(Boost REQUIRED)
  49. find_package(Doxygen REQUIRED)
  50. find_package(TBB)
  51. find_package(Threads REQUIRED)
  52. # If the DEBUG option was turned on, we will target a debug version and a release version otherwise.
  53. if (STORM_DEBUG)
  54. set (CMAKE_BUILD_TYPE "DEBUG")
  55. else()
  56. set (CMAKE_BUILD_TYPE "RELEASE")
  57. endif()
  58. message(STATUS "StoRM - Building ${CMAKE_BUILD_TYPE} version.")
  59. if ("${GUROBI_ROOT}" STREQUAL "")
  60. set(ENABLE_GUROBI OFF)
  61. else()
  62. set(ENABLE_GUROBI ON)
  63. endif()
  64. if ("${Z3_ROOT}" STREQUAL "")
  65. set(ENABLE_Z3 OFF)
  66. else()
  67. set(ENABLE_Z3 ON)
  68. set(Z3_LIB_NAME "z3")
  69. endif()
  70. if(${PARAMETRIC_SYSTEMS})
  71. find_package(carl REQUIRED)
  72. set(STORM_HAVE_CARL ON)
  73. endif()
  74. message(STATUS "StoRM - CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
  75. message(STATUS "StoRM - CMAKE_BUILD_TYPE (ENV): $ENV{CMAKE_BUILD_TYPE}")
  76. #############################################################
  77. ##
  78. ## Compiler specific settings and definitions
  79. ##
  80. #############################################################
  81. # Path to the no-strict-aliasing target
  82. set(CONVERSIONHELPER_TARGET "${PROJECT_SOURCE_DIR}/src/utility/ConversionHelper.cpp")
  83. if(CMAKE_COMPILER_IS_GNUCC)
  84. set(STORM_COMPILED_BY "GCC")
  85. # Set standard flags for GCC
  86. set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -funroll-loops")
  87. add_definitions(-DBOOST_RESULT_OF_USE_DECLTYPE)
  88. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -pedantic")
  89. # Turn on popcnt instruction if desired (yes by default)
  90. if (STORM_USE_POPCNT)
  91. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcnt")
  92. endif(STORM_USE_POPCNT)
  93. # Set the no-strict-aliasing target for GCC
  94. set_source_files_properties(${CONVERSIONHELPER_TARGET} PROPERTIES COMPILE_FLAGS " -fno-strict-aliasing ")
  95. elseif(MSVC)
  96. set(STORM_COMPILED_BY "MSVC")
  97. # required for GMM to compile, ugly error directive in their code
  98. add_definitions(/D_SCL_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS)
  99. # required as the PRCTL Parser bloats object files (COFF) beyond their maximum size (see http://msdn.microsoft.com/en-us/library/8578y171(v=vs.110).aspx)
  100. add_definitions(/bigobj)
  101. # required by GTest and PrismGrammar::createIntegerVariable
  102. add_definitions(/D_VARIADIC_MAX=10)
  103. # Windows.h breaks GMM in gmm_except.h because of its macro definition for min and max
  104. add_definitions(/DNOMINMAX)
  105. # Boost Defs, required for using boost's transform iterator
  106. add_definitions(/DBOOST_RESULT_OF_USE_DECLTYPE)
  107. # since nobody cares at the moment
  108. add_definitions(/wd4250)
  109. if(ENABLE_Z3)
  110. set(Z3_LIB_NAME "libz3")
  111. endif()
  112. # MSVC does not do strict-aliasing, so no option needed
  113. else(CLANG)
  114. set(STORM_COMPILED_BY "Clang (LLVM)")
  115. # As CLANG is not set as a variable, we need to set it in case we have not matched another compiler.
  116. set (CLANG ON)
  117. # Set standard flags for clang
  118. set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -funroll-loops -O3")
  119. if(UNIX AND NOT APPLE AND NOT USE_LIBCXX)
  120. set(CLANG_STDLIB libstdc++)
  121. message(STATUS "StoRM - Linking against libstdc++")
  122. else()
  123. set(CLANG_STDLIB libc++)
  124. message(STATUS "StoRM - Linking against libc++")
  125. # Disable Cotire
  126. set(STORM_USE_COTIRE OFF)
  127. # Set up some Xcode specific settings
  128. set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
  129. set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
  130. endif()
  131. add_definitions(-DBOOST_RESULT_OF_USE_DECLTYPE)
  132. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=${CLANG_STDLIB} -Wall -pedantic -Wno-unused-variable -ftemplate-depth=1024")
  133. # Turn on popcnt instruction if desired (yes by default)
  134. if (STORM_USE_POPCNT)
  135. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcnt")
  136. endif(STORM_USE_POPCNT)
  137. # Set the no-strict-aliasing target for Clang
  138. set_source_files_properties(${CONVERSIONHELPER_TARGET} PROPERTIES COMPILE_FLAGS " -fno-strict-aliasing ")
  139. endif()
  140. message(STATUS "StoRM - Using Compiler Configuration: ${STORM_COMPILED_BY}")
  141. #############################################################
  142. ##
  143. ## CMake-generated Config File for StoRM
  144. ##
  145. #############################################################
  146. #
  147. # Make a version file containing the current version from git.
  148. #
  149. include(GetGitRevisionDescription)
  150. git_describe_checkout(STORM_GIT_VERSION_STRING)
  151. message(STATUS "STORM_GIT_VERSION_STRING: ${STORM_GIT_VERSION_STRING}")
  152. # Parse the git Tag into variables
  153. string(REGEX REPLACE "^([0-9]+)\\..*" "\\1" STORM_CPP_VERSION_MAJOR "${STORM_GIT_VERSION_STRING}")
  154. string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" STORM_CPP_VERSION_MINOR "${STORM_GIT_VERSION_STRING}")
  155. string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" STORM_CPP_VERSION_PATCH "${STORM_GIT_VERSION_STRING}")
  156. string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-([0-9]+)\\-.*" "\\1" STORM_CPP_VERSION_COMMITS_AHEAD "${STORM_GIT_VERSION_STRING}")
  157. string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-[0-9]+\\-([a-z0-9]+).*" "\\1" STORM_CPP_VERSION_HASH "${STORM_GIT_VERSION_STRING}")
  158. string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-[0-9]+\\-[a-z0-9]+\\-(.*)" "\\1" STORM_CPP_VERSION_APPENDIX "${STORM_GIT_VERSION_STRING}")
  159. if ("${STORM_CPP_VERSION_APPENDIX}" MATCHES "^.*dirty.*$")
  160. set(STORM_CPP_VERSION_DIRTY 1)
  161. else()
  162. set(STORM_CPP_VERSION_DIRTY 0)
  163. endif()
  164. message(STATUS "StoRM - Version information: ${STORM_CPP_VERSION_MAJOR}.${STORM_CPP_VERSION_MINOR}.${STORM_CPP_VERSION_PATCH} (${STORM_CPP_VERSION_COMMITS_AHEAD} commits ahead of Tag) build from ${STORM_CPP_VERSION_HASH} (Dirty: ${STORM_CPP_VERSION_DIRTY})")
  165. # Base path for test files
  166. set(STORM_CPP_TESTS_BASE_PATH "${PROJECT_SOURCE_DIR}/test")
  167. # Gurobi Defines
  168. if (ENABLE_GUROBI)
  169. set(STORM_CPP_GUROBI_DEF "define")
  170. else()
  171. set(STORM_CPP_GUROBI_DEF "undef")
  172. endif()
  173. # glpk defines
  174. set(STORM_CPP_GLPK_DEF "define")
  175. # Z3 Defines
  176. if (ENABLE_Z3)
  177. set(STORM_CPP_Z3_DEF "define")
  178. else()
  179. set(STORM_CPP_Z3_DEF "undef")
  180. endif()
  181. # Intel TBB Defines
  182. if (TBB_FOUND AND STORM_USE_INTELTBB)
  183. set(STORM_CPP_INTELTBB_DEF "define")
  184. else()
  185. set(STORM_CPP_INTELTBB_DEF "undef")
  186. endif()
  187. # Configure a header file to pass some of the CMake settings to the source code
  188. configure_file (
  189. "${PROJECT_SOURCE_DIR}/storm-config.h.in"
  190. "${PROJECT_BINARY_DIR}/include/storm-config.h"
  191. )
  192. # Configure a header file to pass the storm version to the source code
  193. configure_file (
  194. "${PROJECT_SOURCE_DIR}/storm-version.cpp.in"
  195. "${PROJECT_SOURCE_DIR}/src/utility/storm-version.cpp"
  196. )
  197. # Add the binary dir include directory for storm-config.h
  198. include_directories("${PROJECT_BINARY_DIR}/include")
  199. #############################################################
  200. ##
  201. ## Source file aggregation and clustering
  202. ##
  203. #############################################################
  204. file(GLOB_RECURSE STORM_HEADERS ${PROJECT_SOURCE_DIR}/src/*.h)
  205. file(GLOB_RECURSE STORM_SOURCES_WITHOUT_MAIN ${PROJECT_SOURCE_DIR}/src/*/*.cpp)
  206. file(GLOB_RECURSE STORM_MAIN_FILE ${PROJECT_SOURCE_DIR}/src/storm.cpp)
  207. file(GLOB_RECURSE STORM_PARAMETRIC_MAIN_FILE ${PROJECT_SOURCE_DIR}/src/stormParametric.cpp)
  208. set(STORM_SOURCES "${STORM_SOURCES_WITHOUT_MAIN};${STORM_MAIN_FILE};${STORM_PARAMETRIC_MAIN_FILE};")
  209. file(GLOB_RECURSE STORM_ADAPTERS_FILES ${PROJECT_SOURCE_DIR}/src/adapters/*.h ${PROJECT_SOURCE_DIR}/src/adapters/*.cpp)
  210. file(GLOB_RECURSE STORM_EXCEPTIONS_FILES ${PROJECT_SOURCE_DIR}/src/exceptions/*.h ${PROJECT_SOURCE_DIR}/src/exceptions/*.cpp)
  211. file(GLOB STORM_PROPERTIES_FILES ${PROJECT_SOURCE_DIR}/src/properties/*.h ${PROJECT_SOURCE_DIR}/src/properties/*.cpp)
  212. file(GLOB_RECURSE STORM_PROPERTIES_CSL_FILES ${PROJECT_SOURCE_DIR}/src/properties/csl/*.h ${PROJECT_SOURCE_DIR}/src/properties/csl/*.cpp)
  213. file(GLOB_RECURSE STORM_PROPERTIES_LTL_FILES ${PROJECT_SOURCE_DIR}/src/properties/ltl/*.h ${PROJECT_SOURCE_DIR}/src/properties/ltl/*.cpp)
  214. file(GLOB_RECURSE STORM_PROPERTIES_PRCTL_FILES ${PROJECT_SOURCE_DIR}/src/properties/prctl/*.h ${PROJECT_SOURCE_DIR}/src/properties/prctl/*.cpp)
  215. file(GLOB_RECURSE STORM_PROPERTIES_ACTIONS_FILES ${PROJECT_SOURCE_DIR}/src/properties/actions/*.h ${PROJECT_SOURCE_DIR}/src/properties/actions/*.cpp)
  216. file(GLOB_RECURSE STORM_MODELCHECKER_FILES ${PROJECT_SOURCE_DIR}/src/modelchecker/*.h ${PROJECT_SOURCE_DIR}/src/modelchecker/*.cpp)
  217. file(GLOB_RECURSE STORM_COUNTEREXAMPLES_FILES ${PROJECT_SOURCE_DIR}/src/counterexamples/*.h ${PROJECT_SOURCE_DIR}/src/counterexamples/*.cpp)
  218. file(GLOB_RECURSE STORM_MODELS_FILES ${PROJECT_SOURCE_DIR}/src/models/*.h ${PROJECT_SOURCE_DIR}/src/models/*.cpp)
  219. file(GLOB STORM_PARSER_FILES ${PROJECT_SOURCE_DIR}/src/parser/*.h ${PROJECT_SOURCE_DIR}/src/parser/*.cpp)
  220. file(GLOB_RECURSE STORM_PARSER_PRISMPARSER_FILES ${PROJECT_SOURCE_DIR}/src/parser/prismparser/*.h ${PROJECT_SOURCE_DIR}/src/parser/prismparser/*.cpp)
  221. file(GLOB STORM_SETTINGS_FILES ${PROJECT_SOURCE_DIR}/src/settings/*.h ${PROJECT_SOURCE_DIR}/src/settings/*.cpp)
  222. file(GLOB STORM_SETTINGS_MODULES_FILES ${PROJECT_SOURCE_DIR}/src/settings/modules/*.h ${PROJECT_SOURCE_DIR}/src/settings/modules/*.cpp)
  223. file(GLOB_RECURSE STORM_SOLVER_FILES ${PROJECT_SOURCE_DIR}/src/solver/*.h ${PROJECT_SOURCE_DIR}/src/solver/*.cpp)
  224. file(GLOB STORM_STORAGE_FILES ${PROJECT_SOURCE_DIR}/src/storage/*.h ${PROJECT_SOURCE_DIR}/src/storage/*.cpp)
  225. file(GLOB_RECURSE STORM_STORAGE_DD_FILES ${PROJECT_SOURCE_DIR}/src/storage/dd/*.h ${PROJECT_SOURCE_DIR}/src/storage/dd/*.cpp)
  226. file(GLOB_RECURSE STORM_STORAGE_EXPRESSIONS_FILES ${PROJECT_SOURCE_DIR}/src/storage/expressions/*.h ${PROJECT_SOURCE_DIR}/src/storage/expressions/*.cpp)
  227. file(GLOB_RECURSE STORM_STORAGE_PRISM_FILES ${PROJECT_SOURCE_DIR}/src/storage/prism/*.h ${PROJECT_SOURCE_DIR}/src/storage/prism/*.cpp)
  228. file(GLOB_RECURSE STORM_STORAGE_SPARSE_FILES ${PROJECT_SOURCE_DIR}/src/storage/sparse/*.h ${PROJECT_SOURCE_DIR}/src/storage/sparse/*.cpp)
  229. file(GLOB_RECURSE STORM_UTILITY_FILES ${PROJECT_SOURCE_DIR}/src/utility/*.h ${PROJECT_SOURCE_DIR}/src/utility/*.cpp)
  230. # Test Sources
  231. # Note that the tests also need the source files, except for the main file
  232. file(GLOB STORM_FUNCTIONAL_TEST_MAIN_FILE ${STORM_CPP_TESTS_BASE_PATH}/functional/storm-functional-tests.cpp)
  233. file(GLOB_RECURSE STORM_FUNCTIONAL_TEST_FILES ${STORM_CPP_TESTS_BASE_PATH}/functional/*.h ${STORM_CPP_TESTS_BASE_PATH}/functional/*.cpp)
  234. file(GLOB STORM_PERFORMANCE_TEST_MAIN_FILE ${STORM_CPP_TESTS_BASE_PATH}/performance/storm-performance-tests.cpp)
  235. file(GLOB_RECURSE STORM_PERFORMANCE_TEST_FILES ${STORM_CPP_TESTS_BASE_PATH}/performance/*/*.h ${STORM_CPP_TESTS_BASE_PATH}/performance/*/*.cpp)
  236. # Additional include files like the storm-config.h
  237. file(GLOB_RECURSE STORM_BUILD_HEADERS ${PROJECT_BINARY_DIR}/include/*.h)
  238. # Group the headers and sources
  239. source_group(main FILES ${STORM_MAIN_FILE})
  240. source_group(adapters FILES ${STORM_ADAPTERS_FILES})
  241. source_group(exceptions FILES ${STORM_EXCEPTIONS_FILES})
  242. source_group(properties FILES ${STORM_PROPERTIES_FILES})
  243. source_group(properties\\csl FILES ${STORM_PROPERTIES_CSL_FILES})
  244. source_group(properties\\ltl FILES ${STORM_PROPERTIES_LTL_FILES})
  245. source_group(properties\\prctl FILES ${STORM_PROPERTIES_PRCTL_FILES})
  246. source_group(properties\\actions FILES ${STORM_PROPERTIES_ACTIONS_FILES})
  247. source_group(generated FILES ${STORM_BUILD_HEADERS} ${STORM_BUILD_SOURCES})
  248. source_group(modelchecker FILES ${STORM_MODELCHECKER_FILES})
  249. source_group(counterexamples FILES ${STORM_COUNTEREXAMPLES_FILES})
  250. source_group(models FILES ${STORM_MODELS_FILES})
  251. source_group(parser FILES ${STORM_PARSER_FILES})
  252. source_group(parser\\prismparser FILES ${STORM_PARSER_PRISMPARSER_FILES})
  253. source_group(settings FILES ${STORM_SETTINGS_FILES})
  254. source_group(settings\\modules FILES ${STORM_SETTINGS_MODULES_FILES})
  255. source_group(solver FILES ${STORM_SOLVER_FILES})
  256. source_group(storage FILES ${STORM_STORAGE_FILES})
  257. source_group(storage\\dd FILES ${STORM_STORAGE_DD_FILES})
  258. source_group(storage\\expressions FILES ${STORM_STORAGE_EXPRESSIONS_FILES})
  259. source_group(storage\\prism FILES ${STORM_STORAGE_PRISM_FILES})
  260. source_group(storage\\sparse FILES ${STORM_STORAGE_SPARSE_FILES})
  261. source_group(utility FILES ${STORM_UTILITY_FILES})
  262. source_group(functional-test FILES ${STORM_FUNCTIONAL_TEST_FILES})
  263. source_group(performance-test FILES ${STORM_PERFORMANCE_TEST_FILES})
  264. # Add custom additional include or link directories
  265. if (ADDITIONAL_INCLUDE_DIRS)
  266. message(STATUS "StoRM - Using additional include directories ${ADDITIONAL_INCLUDE_DIRS}")
  267. include_directories(${ADDITIONAL_INCLUDE_DIRS})
  268. endif(ADDITIONAL_INCLUDE_DIRS)
  269. if (ADDITIONAL_LINK_DIRS)
  270. message(STATUS "StoRM - Using additional link directories ${ADDITIONAL_LINK_DIRS}")
  271. link_directories(${ADDITIONAL_LINK_DIRS})
  272. endif(ADDITIONAL_LINK_DIRS)
  273. #############################################################
  274. ##
  275. ## Pre executable-creation link_directories setup
  276. ##
  277. #############################################################
  278. if (ENABLE_GUROBI)
  279. link_directories("${GUROBI_ROOT}/lib")
  280. endif()
  281. if (ENABLE_Z3)
  282. link_directories("${Z3_ROOT}/bin")
  283. endif()
  284. if ((NOT Boost_LIBRARY_DIRS) OR ("${Boost_LIBRARY_DIRS}" STREQUAL ""))
  285. set(Boost_LIBRARY_DIRS "${Boost_INCLUDE_DIRS}/stage/lib")
  286. endif ()
  287. link_directories(${Boost_LIBRARY_DIRS})
  288. if (TBB_FOUND AND STORM_USE_INTELTBB)
  289. link_directories(${TBB_LIBRARY_DIRS})
  290. endif()
  291. ###############################################################################
  292. ## #
  293. ## Executable Creation #
  294. ## #
  295. ## All link_directories() calls MUST be made before this point #
  296. ## #
  297. ###############################################################################
  298. add_library(storm ${STORM_SOURCES_WITHOUT_MAIN} ${STORM_HEADERS})
  299. add_executable(storm-main ${STORM_MAIN_FILE})
  300. target_link_libraries(storm-main storm)
  301. set_target_properties(storm-main PROPERTIES OUTPUT_NAME "storm")
  302. if(PARAMETRIC_SYSTEMS)
  303. add_executable(storm-main-param ${STORM_PARAMETRIC_MAIN_FILE})
  304. target_link_libraries(storm-main-param storm)
  305. set_target_properties(storm-main-param PROPERTIES OUTPUT_NAME "pstorm")
  306. endif()
  307. add_executable(storm-functional-tests ${STORM_FUNCTIONAL_TEST_MAIN_FILE} ${STORM_FUNCTIONAL_TEST_FILES})
  308. target_link_libraries(storm-functional-tests storm)
  309. add_executable(storm-performance-tests ${STORM_PERFORMANCE_TEST_MAIN_FILE} ${STORM_PERFORMANCE_TEST_FILES})
  310. target_link_libraries(storm-performance-tests storm)
  311. #############################################################
  312. ##
  313. ## Boost
  314. ##
  315. #############################################################
  316. include_directories(${Boost_INCLUDE_DIRS})
  317. target_link_libraries(storm ${Boost_LIBRARIES})
  318. #message(STATUS "BOOST_INCLUDE_DIRS is ${Boost_INCLUDE_DIRS}")
  319. #message(STATUS "BOOST_LIBRARY_DIRS is ${Boost_LIBRARY_DIRS}")
  320. #############################################################
  321. ##
  322. ## CUDD
  323. ##
  324. #############################################################
  325. add_subdirectory("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0")
  326. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/cudd")
  327. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/epd")
  328. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/mtr")
  329. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/nanotrav")
  330. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/obj")
  331. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/st")
  332. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/util")
  333. target_link_libraries(storm cudd)
  334. #############################################################
  335. ##
  336. ## LTL2DSTAR
  337. ##
  338. #############################################################
  339. add_subdirectory("${PROJECT_SOURCE_DIR}/resources/3rdparty/ltl2dstar-0.5.1")
  340. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/ltl2dstar-0.5.1/src")
  341. target_link_libraries(storm ltl2dstar)
  342. #############################################################
  343. ##
  344. ## Gurobi (optional)
  345. ##
  346. #############################################################
  347. if (ENABLE_GUROBI)
  348. message (STATUS "StoRM - Linking with Gurobi")
  349. include_directories("${GUROBI_ROOT}/include")
  350. target_link_libraries(storm "gurobi56")
  351. target_link_libraries(storm-functional-tests "gurobi56")
  352. target_link_libraries(storm-performance-tests "gurobi56")
  353. endif(ENABLE_GUROBI)
  354. #############################################################
  355. ##
  356. ## glpk
  357. ##
  358. #############################################################
  359. message (STATUS "StoRM - Linking with glpk")
  360. add_subdirectory("${PROJECT_SOURCE_DIR}/resources/3rdparty/glpk-4.53")
  361. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/glpk-4.53/src")
  362. target_link_libraries(storm "glpk")
  363. #############################################################
  364. ##
  365. ## Z3 (optional)
  366. ##
  367. #############################################################
  368. if (ENABLE_Z3)
  369. message (STATUS "StoRM - Linking with Z3")
  370. include_directories("${Z3_ROOT}/include")
  371. target_link_libraries(storm ${Z3_LIB_NAME})
  372. endif(ENABLE_Z3)
  373. #############################################################
  374. ##
  375. ## carl
  376. ##
  377. #############################################################
  378. if(PARAMETRIC_SYSTEMS)
  379. message(STATUS "StoRM - Linking with carl")
  380. include_directories("${carl_INCLUDE_DIR}")
  381. target_link_libraries(storm lib_carl)
  382. target_link_libraries(storm-functional-tests lib_carl)
  383. target_link_libraries(storm-performance-tests lib_carl)
  384. endif()
  385. #############################################################
  386. ##
  387. ## Google Test gtest
  388. ##
  389. #############################################################
  390. set(gtest_force_shared_crt ON)
  391. add_subdirectory("${PROJECT_SOURCE_DIR}/resources/3rdparty/gtest-1.7.0")
  392. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/gtest-1.7.0/include")
  393. enable_testing()
  394. target_link_libraries(storm-functional-tests gtest)
  395. target_link_libraries(storm-performance-tests gtest)
  396. add_test(NAME storm-functional-tests COMMAND storm-functional-tests)
  397. add_test(NAME storm-performance-tests COMMAND storm-performance-tests)
  398. #############################################################
  399. ##
  400. ## Log4CPlus
  401. ##
  402. #############################################################
  403. set(BUILD_SHARED_LIBS OFF CACHE BOOL "If TRUE, log4cplus is built as a shared library, otherwise as a static library")
  404. set(LOG4CPLUS_BUILD_LOGGINGSERVER OFF)
  405. set(LOG4CPLUS_BUILD_TESTING OFF)
  406. set(LOG4CPLUS_USE_UNICODE OFF)
  407. set(LOG4CPLUS_DEFINE_INSTALL_TARGET OFF)
  408. add_subdirectory("${PROJECT_SOURCE_DIR}/resources/3rdparty/log4cplus-1.1.3-rc1")
  409. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/log4cplus-1.1.3-rc1/include")
  410. include_directories("${PROJECT_BINARY_DIR}/resources/3rdparty/log4cplus-1.1.3-rc1/include") # This adds the defines.hxx file
  411. target_link_libraries(storm log4cplusS)
  412. target_link_libraries(storm-functional-tests log4cplusS)
  413. target_link_libraries(storm-performance-tests log4cplusS)
  414. if (UNIX AND NOT APPLE)
  415. target_link_libraries(storm rt)
  416. if (STORM_USE_COTIRE)
  417. target_link_libraries(storm_unity rt)
  418. endif(STORM_USE_COTIRE)
  419. endif(UNIX AND NOT APPLE)
  420. #############################################################
  421. ##
  422. ## Intel Threading Building Blocks (optional)
  423. ##
  424. #############################################################
  425. if (TBB_FOUND)
  426. message(STATUS "StoRM - Found Intel TBB with interface version ${TBB_INTERFACE_VERSION}.")
  427. if (STORM_USE_INTELTBB)
  428. message(STATUS "StoRM - Linking with Intel TBB in ${TBB_LIBRARY_DIRS}.")
  429. include_directories(${TBB_INCLUDE_DIRS})
  430. target_link_libraries(storm tbb tbbmalloc)
  431. endif(STORM_USE_INTELTBB)
  432. endif(TBB_FOUND)
  433. #############################################################
  434. ##
  435. ## Threads
  436. ##
  437. #############################################################
  438. include_directories(${THREADS_INCLUDE_DIRS})
  439. target_link_libraries(storm ${CMAKE_THREAD_LIBS_INIT})
  440. if (STORM_USE_COTIRE)
  441. target_link_libraries(storm_unity ${CMAKE_THREAD_LIBS_INIT})
  442. endif(STORM_USE_COTIRE)
  443. if (MSVC)
  444. # Add the DebugHelper DLL
  445. set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} Dbghelp.lib")
  446. target_link_libraries(storm "Dbghelp.lib")
  447. endif(MSVC)
  448. # Print Cotire Usage Status
  449. message (STATUS "StoRM - Using Cotire: ${STORM_USE_COTIRE}")
  450. if (STORM_USE_COTIRE)
  451. # Include Cotire for PCH Generation
  452. set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/resources/cmake")
  453. include(cotire)
  454. cotire(storm)
  455. target_link_libraries(storm_unity ${Boost_LIBRARIES})
  456. #cotire(storm-functional-tests)
  457. #cotire(storm-performance-tests)
  458. endif()
  459. # Link against libc++abi if requested. May be needed to build on Linux systems using clang.
  460. if (LINK_LIBCXXABI)
  461. message (STATUS "StoRM - Linking against libc++abi.")
  462. target_link_libraries(storm "c++abi")
  463. endif(LINK_LIBCXXABI)
  464. # Add a target to generate API documentation with Doxygen
  465. if(DOXYGEN_FOUND)
  466. set(CMAKE_DOXYGEN_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/doc")
  467. string(REGEX REPLACE ";" " " CMAKE_DOXYGEN_INPUT_LIST "${PROJECT_SOURCE_DIR}/src")
  468. configure_file("${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in" "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" @ONLY)
  469. add_custom_target(doc ${DOXYGEN_EXECUTABLE} "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" COMMENT "Generating API documentation with Doxygen" VERBATIM)
  470. endif(DOXYGEN_FOUND)
  471. add_custom_target(memcheck valgrind --leak-check=full --show-reachable=yes ${PROJECT_BINARY_DIR}/storm -v --fix-deadlocks ${PROJECT_SOURCE_DIR}/examples/dtmc/crowds/crowds5_5.tra examples/dtmc/crowds/crowds5_5.lab DEPENDS storm)
  472. add_custom_target(memcheck-functional-tests valgrind --leak-check=full --show-reachable=yes ${PROJECT_BINARY_DIR}/storm-functional-tests -v --fix-deadlocks DEPENDS storm-functional-tests)
  473. add_custom_target(memcheck-performance-tests valgrind --leak-check=full --show-reachable=yes ${PROJECT_BINARY_DIR}/storm-performance-tests -v --fix-deadlocks DEPENDS storm-performance-tests)
  474. set(CPPLINT_ARGS --filter=-whitespace/tab,-whitespace/line_length,-legal/copyright,-readability/streams)
  475. add_custom_target(style python cpplint.py ${CPPLINT_ARGS} `find ./src/ -iname "*.h" -or -iname "*.cpp" `)
  476. INSTALL(TARGETS storm-main storm-functional-tests storm-performance-tests
  477. RUNTIME DESTINATION bin
  478. LIBRARY DESTINATION lib
  479. ARCHIVE DESTINATION lib
  480. )
  481. include(StormCPackConfig.cmake)