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.

448 lines
20 KiB

  1. cmake_minimum_required (VERSION 2.8.6)
  2. # Set project name
  3. project (storm CXX C)
  4. # Set the version number
  5. set (STORM_CPP_VERSION_MAJOR 1)
  6. set (STORM_CPP_VERSION_MINOR 0)
  7. # Add base folder for better inclusion paths
  8. include_directories("${PROJECT_SOURCE_DIR}")
  9. include_directories("${PROJECT_SOURCE_DIR}/src")
  10. # Add the version of Eigen3 in the repository to the include pathes
  11. set(EIGEN3_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/resources/3rdparty/eigen")
  12. include_directories(${EIGEN3_INCLUDE_DIR})
  13. # Add the version of GMM in the repository to the include pathes
  14. set(GMMXX_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/resources/3rdparty/gmm-4.2/include")
  15. include_directories(${GMMXX_INCLUDE_DIR})
  16. #############################################################
  17. ##
  18. ## CMake options of StoRM
  19. ##
  20. #############################################################
  21. option(DEBUG "Sets whether the DEBUG mode is used" ON)
  22. option(USE_POPCNT "Sets whether the popcnt instruction is going to be used." ON)
  23. option(USE_BOOST_STATIC_LIBRARIES "Sets whether the Boost libraries should be linked statically." ON)
  24. option(USE_INTELTBB "Sets whether the Intel TBB Extensions should be used." OFF)
  25. option(STORM_USE_COTIRE "Sets whether Cotire should be used (for building precompiled headers)." OFF)
  26. option(LINK_LIBCXXABI "Sets whether libc++abi should be linked." OFF)
  27. set(GUROBI_ROOT "" CACHE STRING "The root directory of Gurobi (if available).")
  28. set(ADDITIONAL_INCLUDE_DIRS "" CACHE STRING "Additional directories added to the include directories.")
  29. set(ADDITIONAL_LINK_DIRS "" CACHE STRING "Additional directories added to the link directories.")
  30. set(CUSTOM_BOOST_ROOT "" CACHE STRING "A custom path to the Boost root directory.")
  31. #############################################################
  32. ##
  33. ## Inclusion of required libraries
  34. ##
  35. #############################################################
  36. set(TBB_INSTALL_DIR "${PROJECT_SOURCE_DIR}/resources/3rdparty/tbb41_20130314_merged-win-lin-mac/")
  37. if(MSVC)
  38. set(ENV{TBB_ARCH_PLATFORM} "intel64/vc11")
  39. elseif(CMAKE_COMPILER_IS_GNUCC)
  40. set(ENV{TBB_ARCH_PLATFORM} "intel64/gcc4.4")
  41. else(CLANG)
  42. set(ENV{TBB_ARCH_PLATFORM} "intel64/clang3.2")
  43. endif()
  44. # Add the resources/cmake folder to Module Search Path for FindTBB.cmake
  45. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/resources/cmake/")
  46. # Boost Option variables
  47. set(Boost_USE_STATIC_LIBS ON)
  48. set(Boost_USE_MULTITHREADED ON)
  49. set(Boost_USE_STATIC_RUNTIME OFF)
  50. # If a custom boost root directory was specified, we set the corresponding hint for the script to find it.
  51. if(CUSTOM_BOOST_ROOT)
  52. message(STATUS "StoRM - Using Boost from CUSTOM_BOOST_ROOT located at ${CUSTOM_BOOST_ROOT}")
  53. set(BOOST_ROOT "${CUSTOM_BOOST_ROOT}")
  54. endif(CUSTOM_BOOST_ROOT)
  55. find_package(Boost REQUIRED)
  56. find_package(Doxygen REQUIRED)
  57. find_package(TBB)
  58. find_package(Threads REQUIRED)
  59. # If the DEBUG option was turned on, we will target a debug version and a release version otherwise
  60. if (DEBUG)
  61. set (CMAKE_BUILD_TYPE "DEBUG")
  62. else()
  63. set (CMAKE_BUILD_TYPE "RELEASE")
  64. endif()
  65. message(STATUS "StoRM - Building ${CMAKE_BUILD_TYPE} version.")
  66. if ("${GUROBI_ROOT}" STREQUAL "")
  67. set(ENABLE_GUROBI OFF)
  68. else()
  69. set(ENABLE_GUROBI ON)
  70. endif()
  71. message(STATUS "StoRM - CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
  72. message(STATUS "StoRM - CMAKE_BUILD_TYPE (ENV): $ENV{CMAKE_BUILD_TYPE}")
  73. #############################################################
  74. ##
  75. ## Compiler specific settings and definitions
  76. ##
  77. #############################################################
  78. # Path to the no-strict-aliasing target
  79. set(CONVERSIONHELPER_TARGET "${PROJECT_SOURCE_DIR}/src/utility/ConversionHelper.cpp")
  80. if(CMAKE_COMPILER_IS_GNUCC)
  81. message(STATUS "StoRM - Using Compiler Configuration: GCC")
  82. # Set standard flags for GCC
  83. set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -funroll-loops")
  84. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -pedantic")
  85. # -Werror is atm removed as this gave some problems with existing code
  86. # May be re-set later
  87. # (Thomas Heinemann, 2012-12-21)
  88. # Turn on popcnt instruction if desired (yes by default)
  89. if (USE_POPCNT)
  90. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcnt")
  91. endif(USE_POPCNT)
  92. # Set the no-strict-aliasing target for GCC
  93. set_source_files_properties(${CONVERSIONHELPER_TARGET} PROPERTIES COMPILE_FLAGS " -fno-strict-aliasing ")
  94. elseif(MSVC)
  95. message(STATUS "StoRM - Using Compiler Configuration: MSVC")
  96. # required for GMM to compile, ugly error directive in their code
  97. add_definitions(/D_SCL_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS)
  98. # 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)
  99. add_definitions(/bigobj)
  100. # required by GTest and PrismGrammar::createIntegerVariable
  101. add_definitions(/D_VARIADIC_MAX=10)
  102. # MSVC does not do strict-aliasing, so no option needed
  103. else(CLANG)
  104. message(STATUS "StoRM - Using Compiler Configuration: Clang (LLVM)")
  105. # As CLANG is not set as a variable, we need to set it in case we have not matched another compiler.
  106. set (CLANG ON)
  107. # Set standard flags for clang
  108. set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -funroll-loops -O3")
  109. if(UNIX AND NOT APPLE)
  110. set(CLANG_STDLIB libstdc++)
  111. message(STATUS "StoRM - Linking against libstdc++")
  112. else()
  113. set(CLANG_STDLIB libc++)
  114. message(STATUS "StoRM - Linking against libc++")
  115. # Disable Cotire
  116. set(STORM_USE_COTIRE OFF)
  117. # Set up some Xcode specific settings
  118. set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
  119. set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
  120. endif()
  121. 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")
  122. set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
  123. # Turn on popcnt instruction if desired (yes by default)
  124. if (USE_POPCNT)
  125. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcnt")
  126. endif(USE_POPCNT)
  127. # Set the no-strict-aliasing target for Clang
  128. set_source_files_properties(${CONVERSIONHELPER_TARGET} PROPERTIES COMPILE_FLAGS " -fno-strict-aliasing ")
  129. endif()
  130. #############################################################
  131. ##
  132. ## CMake-generated Config File for StoRM
  133. ##
  134. #############################################################
  135. # Base path for test files
  136. set(STORM_CPP_TESTS_BASE_PATH "${PROJECT_SOURCE_DIR}/test")
  137. # Gurobi Defines
  138. if (ENABLE_GUROBI)
  139. set(STORM_CPP_GUROBI_DEF "define")
  140. else()
  141. set(STORM_CPP_GUROBI_DEF "undef")
  142. endif()
  143. # Intel TBB Defines
  144. if (TBB_FOUND AND USE_INTELTBB)
  145. set(STORM_CPP_INTELTBB_DEF "define")
  146. else()
  147. set(STORM_CPP_INTELTBB_DEF "undef")
  148. endif()
  149. # Configure a header file to pass some of the CMake settings to the source code
  150. configure_file (
  151. "${PROJECT_SOURCE_DIR}/storm-config.h.in"
  152. "${PROJECT_BINARY_DIR}/include/storm-config.h"
  153. )
  154. # Add the binary dir include directory for storm-config.h
  155. include_directories("${PROJECT_BINARY_DIR}/include")
  156. #############################################################
  157. ##
  158. ## Source file aggregation and clustering
  159. ##
  160. #############################################################
  161. file(GLOB_RECURSE STORM_HEADERS ${PROJECT_SOURCE_DIR}/src/*.h)
  162. file(GLOB_RECURSE STORM_SOURCES_WITHOUT_MAIN ${PROJECT_SOURCE_DIR}/src/*/*.cpp)
  163. file(GLOB_RECURSE STORM_MAIN_FILE ${PROJECT_SOURCE_DIR}/src/storm.cpp)
  164. set(STORM_SOURCES "${STORM_SOURCES_WITHOUT_MAIN};${STORM_MAIN_FILE}")
  165. file(GLOB_RECURSE STORM_ADAPTERS_FILES ${PROJECT_SOURCE_DIR}/src/adapters/*.h ${PROJECT_SOURCE_DIR}/src/adapters/*.cpp)
  166. file(GLOB_RECURSE STORM_EXCEPTIONS_FILES ${PROJECT_SOURCE_DIR}/src/exceptions/*.h ${PROJECT_SOURCE_DIR}/src/exceptions/*.cpp)
  167. file(GLOB STORM_FORMULA_FILES ${PROJECT_SOURCE_DIR}/src/formula/*.h ${PROJECT_SOURCE_DIR}/src/formula/*.cpp)
  168. file(GLOB_RECURSE STORM_FORMULA_ABSTRACT_FILES ${PROJECT_SOURCE_DIR}/src/formula/abstract/*.h ${PROJECT_SOURCE_DIR}/src/formula/abstract/*.cpp)
  169. file(GLOB_RECURSE STORM_FORMULA_CSL_FILES ${PROJECT_SOURCE_DIR}/src/formula/Csl/*.h ${PROJECT_SOURCE_DIR}/src/formula/Csl/*.cpp)
  170. file(GLOB_RECURSE STORM_FORMULA_LTL_FILES ${PROJECT_SOURCE_DIR}/src/formula/Ltl/*.h ${PROJECT_SOURCE_DIR}/src/formula/Ltl/*.cpp)
  171. file(GLOB_RECURSE STORM_FORMULA_PRCTL_FILES ${PROJECT_SOURCE_DIR}/src/formula/Prctl/*.h ${PROJECT_SOURCE_DIR}/src/formula/Prctl/*.cpp)
  172. file(GLOB_RECURSE STORM_MODELCHECKER_FILES ${PROJECT_SOURCE_DIR}/src/modelchecker/*.h ${PROJECT_SOURCE_DIR}/src/modelchecker/*.cpp)
  173. file(GLOB_RECURSE STORM_COUNTEREXAMPLES_FILES ${PROJECT_SOURCE_DIR}/src/counterexamples/*.h ${PROJECT_SOURCE_DIR}/src/counterexamples/*.cpp)
  174. file(GLOB_RECURSE STORM_MODELS_FILES ${PROJECT_SOURCE_DIR}/src/models/*.h ${PROJECT_SOURCE_DIR}/src/models/*.cpp)
  175. file(GLOB STORM_PARSER_FILES ${PROJECT_SOURCE_DIR}/src/parser/*.h ${PROJECT_SOURCE_DIR}/src/parser/*.cpp)
  176. file(GLOB_RECURSE STORM_PARSER_PRISMPARSER_FILES ${PROJECT_SOURCE_DIR}/src/parser/prismparser/*.h ${PROJECT_SOURCE_DIR}/src/parser/prismparser/*.cpp)
  177. file(GLOB_RECURSE STORM_SETTINGS_FILES ${PROJECT_SOURCE_DIR}/src/settings/*.h ${PROJECT_SOURCE_DIR}/src/settings/*.cpp)
  178. file(GLOB_RECURSE STORM_SOLVER_FILES ${PROJECT_SOURCE_DIR}/src/solver/*.h ${PROJECT_SOURCE_DIR}/src/solver/*.cpp)
  179. file(GLOB_RECURSE STORM_STORAGE_FILES ${PROJECT_SOURCE_DIR}/src/storage/*.h ${PROJECT_SOURCE_DIR}/src/storage/*.cpp)
  180. file(GLOB_RECURSE STORM_UTILITY_FILES ${PROJECT_SOURCE_DIR}/src/utility/*.h ${PROJECT_SOURCE_DIR}/src/utility/*.cpp)
  181. file(GLOB STORM_IR_FILES ${PROJECT_SOURCE_DIR}/src/ir/*.h ${PROJECT_SOURCE_DIR}/src/ir/*.cpp)
  182. file(GLOB_RECURSE STORM_IR_EXPRESSIONS_FILES ${PROJECT_SOURCE_DIR}/src/ir/expressions/*.h ${PROJECT_SOURCE_DIR}/src/ir/expressions/*.cpp)
  183. # Test Sources
  184. # Note that the tests also need the source files, except for the main file
  185. file(GLOB_RECURSE STORM_FUNCTIONAL_TEST_FILES ${STORM_CPP_TESTS_BASE_PATH}/functional/*.h ${STORM_CPP_TESTS_BASE_PATH}/functional/*.cpp)
  186. file(GLOB_RECURSE STORM_PERFORMANCE_TEST_FILES ${STORM_CPP_TESTS_BASE_PATH}/performance/*.h ${STORM_CPP_TESTS_BASE_PATH}/performance/*.cpp)
  187. # Additional include files like the storm-config.h
  188. file(GLOB_RECURSE STORM_BUILD_HEADERS ${PROJECT_BINARY_DIR}/include/*.h)
  189. # Group the headers and sources
  190. source_group(main FILES ${STORM_MAIN_FILE})
  191. source_group(adapters FILES ${STORM_ADAPTERS_FILES})
  192. source_group(exceptions FILES ${STORM_EXCEPTIONS_FILES})
  193. source_group(formula FILES ${STORM_FORMULA_FILES})
  194. source_group(formula\\abstract FILES ${STORM_FORMULA_ABSTRACT_FILES})
  195. source_group(formula\\csl FILES ${STORM_FORMULA_CSL_FILES})
  196. source_group(formula\\ltl FILES ${STORM_FORMULA_LTL_FILES})
  197. source_group(formula\\prctl FILES ${STORM_FORMULA_PRCTL_FILES})
  198. source_group(generated FILES ${STORM_BUILD_HEADERS})
  199. source_group(ir FILES ${STORM_IR_FILES})
  200. source_group(ir\\expressions FILES ${STORM_IR_EXPRESSIONS_FILES})
  201. source_group(modelchecker FILES ${STORM_MODELCHECKER_FILES})
  202. source_group(counterexamples FILES ${STORM_COUNTEREXAMPLES_FILES})
  203. source_group(models FILES ${STORM_MODELS_FILES})
  204. source_group(parser FILES ${STORM_PARSER_FILES})
  205. source_group(parser\\prismparser FILES ${STORM_PARSER_PRISMPARSER_FILES})
  206. source_group(settings FILES ${STORM_SETTINGS_FILES})
  207. source_group(solver FILES ${STORM_SOLVER_FILES})
  208. source_group(storage FILES ${STORM_STORAGE_FILES})
  209. source_group(utility FILES ${STORM_UTILITY_FILES})
  210. source_group(functional-test FILES ${STORM_FUNCTIONAL_TEST_FILES})
  211. source_group(performance-test FILES ${STORM_PERFORMANCE_TEST_FILES})
  212. # Add custom additional include or link directories
  213. if (ADDITIONAL_INCLUDE_DIRS)
  214. message(STATUS "StoRM - Using additional include directories ${ADDITIONAL_INCLUDE_DIRS}")
  215. include_directories(${ADDITIONAL_INCLUDE_DIRS})
  216. endif(ADDITIONAL_INCLUDE_DIRS)
  217. if (ADDITIONAL_LINK_DIRS)
  218. message(STATUS "StoRM - Using additional link directories ${ADDITIONAL_LINK_DIRS}")
  219. link_directories(${ADDITIONAL_LINK_DIRS})
  220. endif(ADDITIONAL_LINK_DIRS)
  221. #############################################################
  222. ##
  223. ## Pre executable-creation link_directories setup
  224. ##
  225. #############################################################
  226. if (ENABLE_GUROBI)
  227. link_directories("${GUROBI_ROOT}/lib")
  228. endif()
  229. if ((NOT Boost_LIBRARY_DIRS) OR ("${Boost_LIBRARY_DIRS}" STREQUAL ""))
  230. set(Boost_LIBRARY_DIRS "${Boost_INCLUDE_DIRS}/stage/lib")
  231. endif ()
  232. link_directories(${Boost_LIBRARY_DIRS})
  233. if (TBB_FOUND AND USE_INTELTBB)
  234. link_directories(${TBB_LIBRARY_DIRS})
  235. endif()
  236. ###############################################################################
  237. ## #
  238. ## Executable Creation #
  239. ## #
  240. ## All link_directories() calls MUST be made before this point #
  241. ## #
  242. ###############################################################################
  243. add_executable(storm ${STORM_SOURCES} ${STORM_HEADERS} ${STORM_BUILD_HEADERS})
  244. add_executable(storm-functional-tests ${STORM_FUNCTIONAL_TEST_FILES} ${STORM_SOURCES_WITHOUT_MAIN} ${STORM_HEADERS} ${STORM_BUILD_HEADERS})
  245. add_executable(storm-performance-tests ${STORM_PERFORMANCE_TEST_FILES} ${STORM_SOURCES_WITHOUT_MAIN} ${STORM_HEADERS} ${STORM_BUILD_HEADERS})
  246. #############################################################
  247. ##
  248. ## Boost
  249. ##
  250. #############################################################
  251. include_directories(${Boost_INCLUDE_DIRS})
  252. target_link_libraries(storm ${Boost_LIBRARIES})
  253. target_link_libraries(storm-functional-tests ${Boost_LIBRARIES})
  254. target_link_libraries(storm-performance-tests ${Boost_LIBRARIES})
  255. #message(STATUS "BOOST_INCLUDE_DIRS is ${Boost_INCLUDE_DIRS}")
  256. #message(STATUS "BOOST_LIBRARY_DIRS is ${Boost_LIBRARY_DIRS}")
  257. #############################################################
  258. ##
  259. ## CUDD
  260. ##
  261. #############################################################
  262. add_subdirectory("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0")
  263. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/cudd")
  264. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/epd")
  265. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/mtr")
  266. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/nanotrav")
  267. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/obj")
  268. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/st")
  269. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/util")
  270. target_link_libraries(storm cudd)
  271. target_link_libraries(storm-functional-tests cudd)
  272. target_link_libraries(storm-performance-tests cudd)
  273. #############################################################
  274. ##
  275. ## LTL2DSTAR
  276. ##
  277. #############################################################
  278. add_subdirectory("${PROJECT_SOURCE_DIR}/resources/3rdparty/ltl2dstar-0.5.1")
  279. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/ltl2dstar-0.5.1/src")
  280. target_link_libraries(storm ltl2dstar)
  281. target_link_libraries(storm-functional-tests ltl2dstar)
  282. target_link_libraries(storm-performance-tests ltl2dstar)
  283. #############################################################
  284. ##
  285. ## Gurobi (optional)
  286. ##
  287. #############################################################
  288. if (ENABLE_GUROBI)
  289. message (STATUS "StoRM - Linking with Gurobi")
  290. include_directories("${GUROBI_ROOT}/include")
  291. target_link_libraries(storm "gurobi55")
  292. target_link_libraries(storm-functional-tests "gurobi55")
  293. target_link_libraries(storm-performance-tests "gurobi55")
  294. endif(ENABLE_GUROBI)
  295. #############################################################
  296. ##
  297. ## Google Test gtest
  298. ##
  299. #############################################################
  300. set(gtest_force_shared_crt ON)
  301. add_subdirectory("${PROJECT_SOURCE_DIR}/resources/3rdparty/gtest-1.7.0")
  302. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/gtest-1.7.0/include")
  303. enable_testing()
  304. target_link_libraries(storm-functional-tests gtest)
  305. target_link_libraries(storm-performance-tests gtest)
  306. add_test(NAME storm-functional-tests COMMAND storm-functional-tests)
  307. add_test(NAME storm-performance-tests COMMAND storm-performance-tests)
  308. #############################################################
  309. ##
  310. ## Log4CPlus
  311. ##
  312. #############################################################
  313. set(BUILD_SHARED_LIBS OFF CACHE BOOL "If TRUE, log4cplus is built as a shared library, otherwise as a static library")
  314. set(LOG4CPLUS_BUILD_TESTING NO)
  315. set(LOG4CPLUS_USE_UNICODE OFF)
  316. add_subdirectory("${PROJECT_SOURCE_DIR}/resources/3rdparty/log4cplus-1.1.2-rc2")
  317. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/log4cplus-1.1.2-rc2/include")
  318. include_directories("${PROJECT_BINARY_DIR}/resources/3rdparty/log4cplus-1.1.2-rc2/include") # This adds the defines.hxx file
  319. target_link_libraries(storm log4cplusS)
  320. target_link_libraries(storm-functional-tests log4cplusS)
  321. target_link_libraries(storm-performance-tests log4cplusS)
  322. if (UNIX AND NOT APPLE)
  323. target_link_libraries(storm rt)
  324. if (STORM_USE_COTIRE)
  325. target_link_libraries(storm_unity rt)
  326. endif(STORM_USE_COTIRE)
  327. target_link_libraries(storm-functional-tests rt)
  328. target_link_libraries(storm-performance-tests rt)
  329. endif(UNIX AND NOT APPLE)
  330. #############################################################
  331. ##
  332. ## Intel Threading Building Blocks (optional)
  333. ##
  334. #############################################################
  335. if (TBB_FOUND)
  336. message(STATUS "StoRM - Found Intel TBB with Interface Version ${TBB_INTERFACE_VERSION}")
  337. if (USE_INTELTBB)
  338. message(STATUS "StoRM - Linking with Intel TBB for activated Matrix/Vector MT")
  339. include_directories(${TBB_INCLUDE_DIRS})
  340. target_link_libraries(storm tbb tbbmalloc)
  341. target_link_libraries(storm-functional-tests tbb tbbmalloc)
  342. target_link_libraries(storm-performance-tests tbb tbbmalloc)
  343. endif(USE_INTELTBB)
  344. endif(TBB_FOUND)
  345. #############################################################
  346. ##
  347. ## Threads
  348. ##
  349. #############################################################
  350. include_directories(${THREADS_INCLUDE_DIRS})
  351. target_link_libraries(storm ${CMAKE_THREAD_LIBS_INIT})
  352. if (STORM_USE_COTIRE)
  353. target_link_libraries(storm_unity ${CMAKE_THREAD_LIBS_INIT})
  354. endif(STORM_USE_COTIRE)
  355. target_link_libraries(storm-functional-tests ${CMAKE_THREAD_LIBS_INIT})
  356. target_link_libraries(storm-performance-tests ${CMAKE_THREAD_LIBS_INIT})
  357. if (MSVC)
  358. # Add the DebugHelper DLL
  359. set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} Dbghelp.lib")
  360. target_link_libraries(storm "Dbghelp.lib")
  361. target_link_libraries(storm-functional-tests "Dbghelp.lib")
  362. target_link_libraries(storm-performance-tests "Dbghelp.lib")
  363. endif(MSVC)
  364. # Print Cotire Usage Status
  365. message (STATUS "StoRM - Using Cotire: ${STORM_USE_COTIRE}")
  366. if (STORM_USE_COTIRE)
  367. # Include Cotire for PCH Generation
  368. set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/resources/cmake")
  369. include(cotire)
  370. cotire(storm)
  371. target_link_libraries(storm_unity ${Boost_LIBRARIES})
  372. #cotire(storm-functional-tests)
  373. #cotire(storm-performance-tests)
  374. endif()
  375. # Link against libc++abi if requested. May be needed to build on Linux systems using clang.
  376. if (LINK_LIBCXXABI)
  377. message (STATUS "StoRM - Linking against libc++abi.")
  378. target_link_libraries(storm "c++abi")
  379. target_link_libraries(storm-functional-tests "c++abi")
  380. target_link_libraries(storm-performance-tests "c++abi")
  381. endif(LINK_LIBCXXABI)
  382. # Add a target to generate API documentation with Doxygen
  383. if(DOXYGEN_FOUND)
  384. set(CMAKE_DOXYGEN_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/doc")
  385. string(REGEX REPLACE ";" " " CMAKE_DOXYGEN_INPUT_LIST "${PROJECT_SOURCE_DIR}/src")
  386. configure_file("${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in" "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" @ONLY)
  387. add_custom_target(doc ${DOXYGEN_EXECUTABLE} "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" COMMENT "Generating API documentation with Doxygen" VERBATIM)
  388. endif(DOXYGEN_FOUND)
  389. 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)
  390. 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)
  391. 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)
  392. set (CPPLINT_ARGS --filter=-whitespace/tab,-whitespace/line_length,-legal/copyright,-readability/streams)
  393. add_custom_target(style python cpplint.py ${CPPLINT_ARGS} `find ./src/ -iname "*.h" -or -iname "*.cpp"`)