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.

554 lines
25 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." OFF)
  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. message(STATUS "StoRM - Using Compiler Configuration: GCC")
  85. # Set standard flags for GCC
  86. set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -funroll-loops")
  87. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -pedantic -DBOOST_RESULT_OF_USE_TR1")
  88. # -Werror is atm removed as this gave some problems with existing code
  89. # May be re-set later
  90. # (Thomas Heinemann, 2012-12-21)
  91. # Turn on popcnt instruction if desired (yes by default)
  92. if (STORM_USE_POPCNT)
  93. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcnt")
  94. endif(STORM_USE_POPCNT)
  95. # Set the no-strict-aliasing target for GCC
  96. set_source_files_properties(${CONVERSIONHELPER_TARGET} PROPERTIES COMPILE_FLAGS " -fno-strict-aliasing ")
  97. elseif(MSVC)
  98. message(STATUS "StoRM - Using Compiler Configuration: MSVC")
  99. # required for GMM to compile, ugly error directive in their code
  100. add_definitions(/D_SCL_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS)
  101. # 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)
  102. add_definitions(/bigobj)
  103. # required by GTest and PrismGrammar::createIntegerVariable
  104. add_definitions(/D_VARIADIC_MAX=10)
  105. # Windows.h breaks GMM in gmm_except.h because of its macro definition for min and max
  106. add_definitions(/DNOMINMAX)
  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. message(STATUS "StoRM - Using Compiler Configuration: 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. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=${CLANG_STDLIB} -Wall -pedantic -Wno-unused-variable -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -ftemplate-depth=1024")
  132. set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
  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. #############################################################
  141. ##
  142. ## CMake-generated Config File for StoRM
  143. ##
  144. #############################################################
  145. #
  146. # Make a version file containing the current version from git.
  147. #
  148. include(GetGitRevisionDescription)
  149. git_describe_checkout(STORM_GIT_VERSION_STRING)
  150. message(STATUS "STORM_GIT_VERSION_STRING: ${STORM_GIT_VERSION_STRING}")
  151. # Parse the git Tag into variables
  152. string(REGEX REPLACE "^([0-9]+)\\..*" "\\1" STORM_CPP_VERSION_MAJOR "${STORM_GIT_VERSION_STRING}")
  153. string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" STORM_CPP_VERSION_MINOR "${STORM_GIT_VERSION_STRING}")
  154. string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" STORM_CPP_VERSION_PATCH "${STORM_GIT_VERSION_STRING}")
  155. string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-([0-9]+)\\-.*" "\\1" STORM_CPP_VERSION_COMMITS_AHEAD "${STORM_GIT_VERSION_STRING}")
  156. string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-[0-9]+\\-([a-z0-9]+).*" "\\1" STORM_CPP_VERSION_HASH "${STORM_GIT_VERSION_STRING}")
  157. string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-[0-9]+\\-[a-z0-9]+\\-(.*)" "\\1" STORM_CPP_VERSION_APPENDIX "${STORM_GIT_VERSION_STRING}")
  158. if ("${STORM_CPP_VERSION_APPENDIX}" MATCHES "^.*dirty.*$")
  159. set(STORM_CPP_VERSION_DIRTY 1)
  160. else()
  161. set(STORM_CPP_VERSION_DIRTY 0)
  162. endif()
  163. 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})")
  164. # Base path for test files
  165. set(STORM_CPP_TESTS_BASE_PATH "${PROJECT_SOURCE_DIR}/test")
  166. # Gurobi Defines
  167. if (ENABLE_GUROBI)
  168. set(STORM_CPP_GUROBI_DEF "define")
  169. else()
  170. set(STORM_CPP_GUROBI_DEF "undef")
  171. endif()
  172. # glpk defines
  173. set(STORM_CPP_GLPK_DEF "define")
  174. # Z3 Defines
  175. if (ENABLE_Z3)
  176. set(STORM_CPP_Z3_DEF "define")
  177. else()
  178. set(STORM_CPP_Z3_DEF "undef")
  179. endif()
  180. # Intel TBB Defines
  181. if (TBB_FOUND AND STORM_USE_INTELTBB)
  182. set(STORM_CPP_INTELTBB_DEF "define")
  183. else()
  184. set(STORM_CPP_INTELTBB_DEF "undef")
  185. endif()
  186. # Configure a header file to pass some of the CMake settings to the source code
  187. configure_file (
  188. "${PROJECT_SOURCE_DIR}/storm-config.h.in"
  189. "${PROJECT_BINARY_DIR}/include/storm-config.h"
  190. )
  191. # Configure a header file to pass the storm version to the source code
  192. configure_file (
  193. "${PROJECT_SOURCE_DIR}/storm-version.h.in"
  194. "${PROJECT_BINARY_DIR}/include/storm-version.h"
  195. )
  196. # Add the binary dir include directory for storm-config.h
  197. include_directories("${PROJECT_BINARY_DIR}/include")
  198. #############################################################
  199. ##
  200. ## Source file aggregation and clustering
  201. ##
  202. #############################################################
  203. file(GLOB_RECURSE STORM_HEADERS ${PROJECT_SOURCE_DIR}/src/*.h)
  204. file(GLOB_RECURSE STORM_SOURCES_WITHOUT_MAIN ${PROJECT_SOURCE_DIR}/src/*/*.cpp)
  205. file(GLOB_RECURSE STORM_MAIN_FILE ${PROJECT_SOURCE_DIR}/src/storm.cpp)
  206. file(GLOB_RECURSE STORM_PARAMETRIC_MAIN_FILE ${PROJECT_SOURCE_DIR}/src/stormParametric.cpp)
  207. set(STORM_SOURCES "${STORM_SOURCES_WITHOUT_MAIN};${STORM_MAIN_FILE};${STORM_PARAMETRIC_MAIN_FILE};")
  208. file(GLOB_RECURSE STORM_ADAPTERS_FILES ${PROJECT_SOURCE_DIR}/src/adapters/*.h ${PROJECT_SOURCE_DIR}/src/adapters/*.cpp)
  209. file(GLOB_RECURSE STORM_EXCEPTIONS_FILES ${PROJECT_SOURCE_DIR}/src/exceptions/*.h ${PROJECT_SOURCE_DIR}/src/exceptions/*.cpp)
  210. file(GLOB STORM_FORMULA_FILES ${PROJECT_SOURCE_DIR}/src/formula/*.h ${PROJECT_SOURCE_DIR}/src/formula/*.cpp)
  211. file(GLOB_RECURSE STORM_FORMULA_ABSTRACT_FILES ${PROJECT_SOURCE_DIR}/src/formula/abstract/*.h ${PROJECT_SOURCE_DIR}/src/formula/abstract/*.cpp)
  212. file(GLOB_RECURSE STORM_FORMULA_CSL_FILES ${PROJECT_SOURCE_DIR}/src/formula/Csl/*.h ${PROJECT_SOURCE_DIR}/src/formula/Csl/*.cpp)
  213. file(GLOB_RECURSE STORM_FORMULA_LTL_FILES ${PROJECT_SOURCE_DIR}/src/formula/Ltl/*.h ${PROJECT_SOURCE_DIR}/src/formula/Ltl/*.cpp)
  214. file(GLOB_RECURSE STORM_FORMULA_PRCTL_FILES ${PROJECT_SOURCE_DIR}/src/formula/Prctl/*.h ${PROJECT_SOURCE_DIR}/src/formula/Prctl/*.cpp)
  215. file(GLOB_RECURSE STORM_MODELCHECKER_FILES ${PROJECT_SOURCE_DIR}/src/modelchecker/*.h ${PROJECT_SOURCE_DIR}/src/modelchecker/*.cpp)
  216. file(GLOB_RECURSE STORM_COUNTEREXAMPLES_FILES ${PROJECT_SOURCE_DIR}/src/counterexamples/*.h ${PROJECT_SOURCE_DIR}/src/counterexamples/*.cpp)
  217. file(GLOB_RECURSE STORM_MODELS_FILES ${PROJECT_SOURCE_DIR}/src/models/*.h ${PROJECT_SOURCE_DIR}/src/models/*.cpp)
  218. file(GLOB STORM_PARSER_FILES ${PROJECT_SOURCE_DIR}/src/parser/*.h ${PROJECT_SOURCE_DIR}/src/parser/*.cpp)
  219. file(GLOB_RECURSE STORM_PARSER_PRISMPARSER_FILES ${PROJECT_SOURCE_DIR}/src/parser/prismparser/*.h ${PROJECT_SOURCE_DIR}/src/parser/prismparser/*.cpp)
  220. file(GLOB_RECURSE STORM_SETTINGS_FILES ${PROJECT_SOURCE_DIR}/src/settings/*.h ${PROJECT_SOURCE_DIR}/src/settings/*.cpp)
  221. file(GLOB_RECURSE STORM_SOLVER_FILES ${PROJECT_SOURCE_DIR}/src/solver/*.h ${PROJECT_SOURCE_DIR}/src/solver/*.cpp)
  222. file(GLOB STORM_STORAGE_FILES ${PROJECT_SOURCE_DIR}/src/storage/*.h ${PROJECT_SOURCE_DIR}/src/storage/*.cpp)
  223. file(GLOB_RECURSE STORM_STORAGE_DD_FILES ${PROJECT_SOURCE_DIR}/src/storage/dd/*.h ${PROJECT_SOURCE_DIR}/src/storage/dd/*.cpp)
  224. file(GLOB_RECURSE STORM_STORAGE_EXPRESSIONS_FILES ${PROJECT_SOURCE_DIR}/src/storage/expressions/*.h ${PROJECT_SOURCE_DIR}/src/storage/expressions/*.cpp)
  225. file(GLOB_RECURSE STORM_STORAGE_PRISM_FILES ${PROJECT_SOURCE_DIR}/src/storage/prism/*.h ${PROJECT_SOURCE_DIR}/src/storage/prism/*.cpp)
  226. file(GLOB_RECURSE STORM_UTILITY_FILES ${PROJECT_SOURCE_DIR}/src/utility/*.h ${PROJECT_SOURCE_DIR}/src/utility/*.cpp)
  227. # Test Sources
  228. # Note that the tests also need the source files, except for the main file
  229. file(GLOB_RECURSE STORM_FUNCTIONAL_TEST_FILES ${STORM_CPP_TESTS_BASE_PATH}/functional/*.h ${STORM_CPP_TESTS_BASE_PATH}/functional/*.cpp)
  230. file(GLOB_RECURSE STORM_PERFORMANCE_TEST_FILES ${STORM_CPP_TESTS_BASE_PATH}/performance/*.h ${STORM_CPP_TESTS_BASE_PATH}/performance/*.cpp)
  231. # Additional include files like the storm-config.h
  232. file(GLOB_RECURSE STORM_BUILD_HEADERS ${PROJECT_BINARY_DIR}/include/*.h)
  233. # Group the headers and sources
  234. source_group(main FILES ${STORM_MAIN_FILE})
  235. source_group(adapters FILES ${STORM_ADAPTERS_FILES})
  236. source_group(exceptions FILES ${STORM_EXCEPTIONS_FILES})
  237. source_group(formula FILES ${STORM_FORMULA_FILES})
  238. source_group(formula\\abstract FILES ${STORM_FORMULA_ABSTRACT_FILES})
  239. source_group(formula\\csl FILES ${STORM_FORMULA_CSL_FILES})
  240. source_group(formula\\ltl FILES ${STORM_FORMULA_LTL_FILES})
  241. source_group(formula\\prctl FILES ${STORM_FORMULA_PRCTL_FILES})
  242. source_group(generated FILES ${STORM_BUILD_HEADERS})
  243. source_group(modelchecker FILES ${STORM_MODELCHECKER_FILES})
  244. source_group(counterexamples FILES ${STORM_COUNTEREXAMPLES_FILES})
  245. source_group(models FILES ${STORM_MODELS_FILES})
  246. source_group(parser FILES ${STORM_PARSER_FILES})
  247. source_group(parser\\prismparser FILES ${STORM_PARSER_PRISMPARSER_FILES})
  248. source_group(settings FILES ${STORM_SETTINGS_FILES})
  249. source_group(solver FILES ${STORM_SOLVER_FILES})
  250. source_group(storage FILES ${STORM_STORAGE_FILES})
  251. source_group(storage\\dd FILES ${STORM_STORAGE_DD_FILES})
  252. source_group(storage\\expressions FILES ${STORM_STORAGE_EXPRESSIONS_FILES})
  253. source_group(storage\\prism FILES ${STORM_STORAGE_PRISM_FILES})
  254. source_group(utility FILES ${STORM_UTILITY_FILES})
  255. source_group(functional-test FILES ${STORM_FUNCTIONAL_TEST_FILES})
  256. source_group(performance-test FILES ${STORM_PERFORMANCE_TEST_FILES})
  257. # Add custom additional include or link directories
  258. if (ADDITIONAL_INCLUDE_DIRS)
  259. message(STATUS "StoRM - Using additional include directories ${ADDITIONAL_INCLUDE_DIRS}")
  260. include_directories(${ADDITIONAL_INCLUDE_DIRS})
  261. endif(ADDITIONAL_INCLUDE_DIRS)
  262. if (ADDITIONAL_LINK_DIRS)
  263. message(STATUS "StoRM - Using additional link directories ${ADDITIONAL_LINK_DIRS}")
  264. link_directories(${ADDITIONAL_LINK_DIRS})
  265. endif(ADDITIONAL_LINK_DIRS)
  266. #############################################################
  267. ##
  268. ## Pre executable-creation link_directories setup
  269. ##
  270. #############################################################
  271. if (ENABLE_GUROBI)
  272. link_directories("${GUROBI_ROOT}/lib")
  273. endif()
  274. if (ENABLE_Z3)
  275. link_directories("${Z3_ROOT}/bin")
  276. endif()
  277. if ((NOT Boost_LIBRARY_DIRS) OR ("${Boost_LIBRARY_DIRS}" STREQUAL ""))
  278. set(Boost_LIBRARY_DIRS "${Boost_INCLUDE_DIRS}/stage/lib")
  279. endif ()
  280. link_directories(${Boost_LIBRARY_DIRS})
  281. if (TBB_FOUND AND STORM_USE_INTELTBB)
  282. link_directories(${TBB_LIBRARY_DIRS})
  283. endif()
  284. ###############################################################################
  285. ## #
  286. ## Executable Creation #
  287. ## #
  288. ## All link_directories() calls MUST be made before this point #
  289. ## #
  290. ###############################################################################
  291. add_executable(storm ${STORM_SOURCES} ${STORM_HEADERS} ${STORM_BUILD_HEADERS})
  292. add_executable(storm-functional-tests ${STORM_FUNCTIONAL_TEST_FILES} ${STORM_SOURCES_WITHOUT_MAIN} ${STORM_HEADERS} ${STORM_BUILD_HEADERS})
  293. add_executable(storm-performance-tests ${STORM_PERFORMANCE_TEST_FILES} ${STORM_SOURCES_WITHOUT_MAIN} ${STORM_HEADERS} ${STORM_BUILD_HEADERS})
  294. #############################################################
  295. ##
  296. ## Boost
  297. ##
  298. #############################################################
  299. include_directories(${Boost_INCLUDE_DIRS})
  300. target_link_libraries(storm ${Boost_LIBRARIES})
  301. target_link_libraries(storm-functional-tests ${Boost_LIBRARIES})
  302. target_link_libraries(storm-performance-tests ${Boost_LIBRARIES})
  303. #message(STATUS "BOOST_INCLUDE_DIRS is ${Boost_INCLUDE_DIRS}")
  304. #message(STATUS "BOOST_LIBRARY_DIRS is ${Boost_LIBRARY_DIRS}")
  305. #############################################################
  306. ##
  307. ## CUDD
  308. ##
  309. #############################################################
  310. add_subdirectory("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0")
  311. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/cudd")
  312. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/epd")
  313. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/mtr")
  314. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/nanotrav")
  315. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/obj")
  316. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/st")
  317. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/util")
  318. target_link_libraries(storm cudd)
  319. target_link_libraries(storm-functional-tests cudd)
  320. target_link_libraries(storm-performance-tests cudd)
  321. #############################################################
  322. ##
  323. ## LTL2DSTAR
  324. ##
  325. #############################################################
  326. add_subdirectory("${PROJECT_SOURCE_DIR}/resources/3rdparty/ltl2dstar-0.5.1")
  327. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/ltl2dstar-0.5.1/src")
  328. target_link_libraries(storm ltl2dstar)
  329. target_link_libraries(storm-functional-tests ltl2dstar)
  330. target_link_libraries(storm-performance-tests ltl2dstar)
  331. #############################################################
  332. ##
  333. ## Gurobi (optional)
  334. ##
  335. #############################################################
  336. if (ENABLE_GUROBI)
  337. message (STATUS "StoRM - Linking with Gurobi")
  338. include_directories("${GUROBI_ROOT}/include")
  339. target_link_libraries(storm "gurobi56")
  340. target_link_libraries(storm-functional-tests "gurobi56")
  341. target_link_libraries(storm-performance-tests "gurobi56")
  342. endif(ENABLE_GUROBI)
  343. #############################################################
  344. ##
  345. ## glpk
  346. ##
  347. #############################################################
  348. message (STATUS "StoRM - Linking with glpk")
  349. add_subdirectory("${PROJECT_SOURCE_DIR}/resources/3rdparty/glpk-4.53")
  350. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/glpk-4.53/src")
  351. target_link_libraries(storm "glpk")
  352. target_link_libraries(storm-functional-tests "glpk")
  353. target_link_libraries(storm-performance-tests "glpk")
  354. #############################################################
  355. ##
  356. ## Z3 (optional)
  357. ##
  358. #############################################################
  359. if (ENABLE_Z3)
  360. message (STATUS "StoRM - Linking with Z3")
  361. include_directories("${Z3_ROOT}/include")
  362. target_link_libraries(storm ${Z3_LIB_NAME})
  363. target_link_libraries(storm-functional-tests ${Z3_LIB_NAME})
  364. target_link_libraries(storm-performance-tests ${Z3_LIB_NAME})
  365. endif(ENABLE_Z3)
  366. #############################################################
  367. ##
  368. ## carl
  369. ##
  370. #############################################################
  371. if(PARAMETRIC_SYSTEMS)
  372. message(STATUS "StoRM - Linking with carl")
  373. include_directories("${carl_INCLUDE_DIR}")
  374. target_link_libraries(storm lib_carl)
  375. target_link_libraries(storm-functional-tests lib_carl)
  376. target_link_libraries(storm-performance-tests lib_carl)
  377. endif()
  378. #############################################################
  379. ##
  380. ## Google Test gtest
  381. ##
  382. #############################################################
  383. set(gtest_force_shared_crt ON)
  384. add_subdirectory("${PROJECT_SOURCE_DIR}/resources/3rdparty/gtest-1.7.0")
  385. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/gtest-1.7.0/include")
  386. enable_testing()
  387. target_link_libraries(storm-functional-tests gtest)
  388. target_link_libraries(storm-performance-tests gtest)
  389. add_test(NAME storm-functional-tests COMMAND storm-functional-tests)
  390. add_test(NAME storm-performance-tests COMMAND storm-performance-tests)
  391. #############################################################
  392. ##
  393. ## Log4CPlus
  394. ##
  395. #############################################################
  396. set(BUILD_SHARED_LIBS OFF CACHE BOOL "If TRUE, log4cplus is built as a shared library, otherwise as a static library")
  397. set(LOG4CPLUS_BUILD_LOGGINGSERVER OFF)
  398. set(LOG4CPLUS_BUILD_TESTING OFF)
  399. set(LOG4CPLUS_USE_UNICODE OFF)
  400. set(LOG4CPLUS_DEFINE_INSTALL_TARGET OFF)
  401. add_subdirectory("${PROJECT_SOURCE_DIR}/resources/3rdparty/log4cplus-1.1.3-rc1")
  402. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/log4cplus-1.1.3-rc1/include")
  403. include_directories("${PROJECT_BINARY_DIR}/resources/3rdparty/log4cplus-1.1.3-rc1/include") # This adds the defines.hxx file
  404. target_link_libraries(storm log4cplusS)
  405. target_link_libraries(storm-functional-tests log4cplusS)
  406. target_link_libraries(storm-performance-tests log4cplusS)
  407. if (UNIX AND NOT APPLE)
  408. target_link_libraries(storm rt)
  409. if (STORM_USE_COTIRE)
  410. target_link_libraries(storm_unity rt)
  411. endif(STORM_USE_COTIRE)
  412. target_link_libraries(storm-functional-tests rt)
  413. target_link_libraries(storm-performance-tests rt)
  414. endif(UNIX AND NOT APPLE)
  415. #############################################################
  416. ##
  417. ## Intel Threading Building Blocks (optional)
  418. ##
  419. #############################################################
  420. if (TBB_FOUND)
  421. message(STATUS "StoRM - Found Intel TBB with interface version ${TBB_INTERFACE_VERSION}.")
  422. if (STORM_USE_INTELTBB)
  423. message(STATUS "StoRM - Linking with Intel TBB in ${TBB_LIBRARY_DIRS}.")
  424. include_directories(${TBB_INCLUDE_DIRS})
  425. target_link_libraries(storm tbb tbbmalloc)
  426. target_link_libraries(storm-functional-tests tbb tbbmalloc)
  427. target_link_libraries(storm-performance-tests tbb tbbmalloc)
  428. endif(STORM_USE_INTELTBB)
  429. endif(TBB_FOUND)
  430. #############################################################
  431. ##
  432. ## Threads
  433. ##
  434. #############################################################
  435. include_directories(${THREADS_INCLUDE_DIRS})
  436. target_link_libraries(storm ${CMAKE_THREAD_LIBS_INIT})
  437. if (STORM_USE_COTIRE)
  438. target_link_libraries(storm_unity ${CMAKE_THREAD_LIBS_INIT})
  439. endif(STORM_USE_COTIRE)
  440. target_link_libraries(storm-functional-tests ${CMAKE_THREAD_LIBS_INIT})
  441. target_link_libraries(storm-performance-tests ${CMAKE_THREAD_LIBS_INIT})
  442. if (MSVC)
  443. # Add the DebugHelper DLL
  444. set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} Dbghelp.lib")
  445. target_link_libraries(storm "Dbghelp.lib")
  446. target_link_libraries(storm-functional-tests "Dbghelp.lib")
  447. target_link_libraries(storm-performance-tests "Dbghelp.lib")
  448. endif(MSVC)
  449. # Print Cotire Usage Status
  450. message (STATUS "StoRM - Using Cotire: ${STORM_USE_COTIRE}")
  451. if (STORM_USE_COTIRE)
  452. # Include Cotire for PCH Generation
  453. set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/resources/cmake")
  454. include(cotire)
  455. cotire(storm)
  456. target_link_libraries(storm_unity ${Boost_LIBRARIES})
  457. #cotire(storm-functional-tests)
  458. #cotire(storm-performance-tests)
  459. endif()
  460. # Link against libc++abi if requested. May be needed to build on Linux systems using clang.
  461. if (LINK_LIBCXXABI)
  462. message (STATUS "StoRM - Linking against libc++abi.")
  463. target_link_libraries(storm "c++abi")
  464. target_link_libraries(storm-functional-tests "c++abi")
  465. target_link_libraries(storm-performance-tests "c++abi")
  466. endif(LINK_LIBCXXABI)
  467. # Add a target to generate API documentation with Doxygen
  468. if(DOXYGEN_FOUND)
  469. set(CMAKE_DOXYGEN_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/doc")
  470. string(REGEX REPLACE ";" " " CMAKE_DOXYGEN_INPUT_LIST "${PROJECT_SOURCE_DIR}/src")
  471. configure_file("${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in" "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" @ONLY)
  472. add_custom_target(doc ${DOXYGEN_EXECUTABLE} "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" COMMENT "Generating API documentation with Doxygen" VERBATIM)
  473. endif(DOXYGEN_FOUND)
  474. 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)
  475. 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)
  476. 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)
  477. set(CPPLINT_ARGS --filter=-whitespace/tab,-whitespace/line_length,-legal/copyright,-readability/streams)
  478. add_custom_target(style python cpplint.py ${CPPLINT_ARGS} `find ./src/ -iname "*.h" -or -iname "*.cpp" `)
  479. INSTALL(TARGETS storm storm-functional-tests storm-performance-tests
  480. RUNTIME DESTINATION bin
  481. LIBRARY DESTINATION lib
  482. ARCHIVE DESTINATION lib
  483. )
  484. include(StormCPackConfig.cmake)