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.

450 lines
21 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. # Windows.h breaks GMM in gmm_except.h because of its macro definition for min and max
  103. add_definitions(/DNOMINMAX)
  104. # MSVC does not do strict-aliasing, so no option needed
  105. else(CLANG)
  106. message(STATUS "StoRM - Using Compiler Configuration: Clang (LLVM)")
  107. # As CLANG is not set as a variable, we need to set it in case we have not matched another compiler.
  108. set (CLANG ON)
  109. # Set standard flags for clang
  110. set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -funroll-loops -O3")
  111. if(UNIX AND NOT APPLE)
  112. set(CLANG_STDLIB libstdc++)
  113. message(STATUS "StoRM - Linking against libstdc++")
  114. else()
  115. set(CLANG_STDLIB libc++)
  116. message(STATUS "StoRM - Linking against libc++")
  117. # Disable Cotire
  118. set(STORM_USE_COTIRE OFF)
  119. # Set up some Xcode specific settings
  120. set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
  121. set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
  122. endif()
  123. 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")
  124. set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
  125. # Turn on popcnt instruction if desired (yes by default)
  126. if (USE_POPCNT)
  127. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcnt")
  128. endif(USE_POPCNT)
  129. # Set the no-strict-aliasing target for Clang
  130. set_source_files_properties(${CONVERSIONHELPER_TARGET} PROPERTIES COMPILE_FLAGS " -fno-strict-aliasing ")
  131. endif()
  132. #############################################################
  133. ##
  134. ## CMake-generated Config File for StoRM
  135. ##
  136. #############################################################
  137. # Base path for test files
  138. set(STORM_CPP_TESTS_BASE_PATH "${PROJECT_SOURCE_DIR}/test")
  139. # Gurobi Defines
  140. if (ENABLE_GUROBI)
  141. set(STORM_CPP_GUROBI_DEF "define")
  142. else()
  143. set(STORM_CPP_GUROBI_DEF "undef")
  144. endif()
  145. # Intel TBB Defines
  146. if (TBB_FOUND AND USE_INTELTBB)
  147. set(STORM_CPP_INTELTBB_DEF "define")
  148. else()
  149. set(STORM_CPP_INTELTBB_DEF "undef")
  150. endif()
  151. # Configure a header file to pass some of the CMake settings to the source code
  152. configure_file (
  153. "${PROJECT_SOURCE_DIR}/storm-config.h.in"
  154. "${PROJECT_BINARY_DIR}/include/storm-config.h"
  155. )
  156. # Add the binary dir include directory for storm-config.h
  157. include_directories("${PROJECT_BINARY_DIR}/include")
  158. #############################################################
  159. ##
  160. ## Source file aggregation and clustering
  161. ##
  162. #############################################################
  163. file(GLOB_RECURSE STORM_HEADERS ${PROJECT_SOURCE_DIR}/src/*.h)
  164. file(GLOB_RECURSE STORM_SOURCES_WITHOUT_MAIN ${PROJECT_SOURCE_DIR}/src/*/*.cpp)
  165. file(GLOB_RECURSE STORM_MAIN_FILE ${PROJECT_SOURCE_DIR}/src/storm.cpp)
  166. set(STORM_SOURCES "${STORM_SOURCES_WITHOUT_MAIN};${STORM_MAIN_FILE}")
  167. file(GLOB_RECURSE STORM_ADAPTERS_FILES ${PROJECT_SOURCE_DIR}/src/adapters/*.h ${PROJECT_SOURCE_DIR}/src/adapters/*.cpp)
  168. file(GLOB_RECURSE STORM_EXCEPTIONS_FILES ${PROJECT_SOURCE_DIR}/src/exceptions/*.h ${PROJECT_SOURCE_DIR}/src/exceptions/*.cpp)
  169. file(GLOB STORM_FORMULA_FILES ${PROJECT_SOURCE_DIR}/src/formula/*.h ${PROJECT_SOURCE_DIR}/src/formula/*.cpp)
  170. file(GLOB_RECURSE STORM_FORMULA_ABSTRACT_FILES ${PROJECT_SOURCE_DIR}/src/formula/abstract/*.h ${PROJECT_SOURCE_DIR}/src/formula/abstract/*.cpp)
  171. file(GLOB_RECURSE STORM_FORMULA_CSL_FILES ${PROJECT_SOURCE_DIR}/src/formula/Csl/*.h ${PROJECT_SOURCE_DIR}/src/formula/Csl/*.cpp)
  172. file(GLOB_RECURSE STORM_FORMULA_LTL_FILES ${PROJECT_SOURCE_DIR}/src/formula/Ltl/*.h ${PROJECT_SOURCE_DIR}/src/formula/Ltl/*.cpp)
  173. file(GLOB_RECURSE STORM_FORMULA_PRCTL_FILES ${PROJECT_SOURCE_DIR}/src/formula/Prctl/*.h ${PROJECT_SOURCE_DIR}/src/formula/Prctl/*.cpp)
  174. file(GLOB_RECURSE STORM_MODELCHECKER_FILES ${PROJECT_SOURCE_DIR}/src/modelchecker/*.h ${PROJECT_SOURCE_DIR}/src/modelchecker/*.cpp)
  175. file(GLOB_RECURSE STORM_COUNTEREXAMPLES_FILES ${PROJECT_SOURCE_DIR}/src/counterexamples/*.h ${PROJECT_SOURCE_DIR}/src/counterexamples/*.cpp)
  176. file(GLOB_RECURSE STORM_MODELS_FILES ${PROJECT_SOURCE_DIR}/src/models/*.h ${PROJECT_SOURCE_DIR}/src/models/*.cpp)
  177. file(GLOB STORM_PARSER_FILES ${PROJECT_SOURCE_DIR}/src/parser/*.h ${PROJECT_SOURCE_DIR}/src/parser/*.cpp)
  178. file(GLOB_RECURSE STORM_PARSER_PRISMPARSER_FILES ${PROJECT_SOURCE_DIR}/src/parser/prismparser/*.h ${PROJECT_SOURCE_DIR}/src/parser/prismparser/*.cpp)
  179. file(GLOB_RECURSE STORM_SETTINGS_FILES ${PROJECT_SOURCE_DIR}/src/settings/*.h ${PROJECT_SOURCE_DIR}/src/settings/*.cpp)
  180. file(GLOB_RECURSE STORM_SOLVER_FILES ${PROJECT_SOURCE_DIR}/src/solver/*.h ${PROJECT_SOURCE_DIR}/src/solver/*.cpp)
  181. file(GLOB_RECURSE STORM_STORAGE_FILES ${PROJECT_SOURCE_DIR}/src/storage/*.h ${PROJECT_SOURCE_DIR}/src/storage/*.cpp)
  182. file(GLOB_RECURSE STORM_UTILITY_FILES ${PROJECT_SOURCE_DIR}/src/utility/*.h ${PROJECT_SOURCE_DIR}/src/utility/*.cpp)
  183. file(GLOB STORM_IR_FILES ${PROJECT_SOURCE_DIR}/src/ir/*.h ${PROJECT_SOURCE_DIR}/src/ir/*.cpp)
  184. file(GLOB_RECURSE STORM_IR_EXPRESSIONS_FILES ${PROJECT_SOURCE_DIR}/src/ir/expressions/*.h ${PROJECT_SOURCE_DIR}/src/ir/expressions/*.cpp)
  185. # Test Sources
  186. # Note that the tests also need the source files, except for the main file
  187. file(GLOB_RECURSE STORM_FUNCTIONAL_TEST_FILES ${STORM_CPP_TESTS_BASE_PATH}/functional/*.h ${STORM_CPP_TESTS_BASE_PATH}/functional/*.cpp)
  188. file(GLOB_RECURSE STORM_PERFORMANCE_TEST_FILES ${STORM_CPP_TESTS_BASE_PATH}/performance/*.h ${STORM_CPP_TESTS_BASE_PATH}/performance/*.cpp)
  189. # Additional include files like the storm-config.h
  190. file(GLOB_RECURSE STORM_BUILD_HEADERS ${PROJECT_BINARY_DIR}/include/*.h)
  191. # Group the headers and sources
  192. source_group(main FILES ${STORM_MAIN_FILE})
  193. source_group(adapters FILES ${STORM_ADAPTERS_FILES})
  194. source_group(exceptions FILES ${STORM_EXCEPTIONS_FILES})
  195. source_group(formula FILES ${STORM_FORMULA_FILES})
  196. source_group(formula\\abstract FILES ${STORM_FORMULA_ABSTRACT_FILES})
  197. source_group(formula\\csl FILES ${STORM_FORMULA_CSL_FILES})
  198. source_group(formula\\ltl FILES ${STORM_FORMULA_LTL_FILES})
  199. source_group(formula\\prctl FILES ${STORM_FORMULA_PRCTL_FILES})
  200. source_group(generated FILES ${STORM_BUILD_HEADERS})
  201. source_group(ir FILES ${STORM_IR_FILES})
  202. source_group(ir\\expressions FILES ${STORM_IR_EXPRESSIONS_FILES})
  203. source_group(modelchecker FILES ${STORM_MODELCHECKER_FILES})
  204. source_group(counterexamples FILES ${STORM_COUNTEREXAMPLES_FILES})
  205. source_group(models FILES ${STORM_MODELS_FILES})
  206. source_group(parser FILES ${STORM_PARSER_FILES})
  207. source_group(parser\\prismparser FILES ${STORM_PARSER_PRISMPARSER_FILES})
  208. source_group(settings FILES ${STORM_SETTINGS_FILES})
  209. source_group(solver FILES ${STORM_SOLVER_FILES})
  210. source_group(storage FILES ${STORM_STORAGE_FILES})
  211. source_group(utility FILES ${STORM_UTILITY_FILES})
  212. source_group(functional-test FILES ${STORM_FUNCTIONAL_TEST_FILES})
  213. source_group(performance-test FILES ${STORM_PERFORMANCE_TEST_FILES})
  214. # Add custom additional include or link directories
  215. if (ADDITIONAL_INCLUDE_DIRS)
  216. message(STATUS "StoRM - Using additional include directories ${ADDITIONAL_INCLUDE_DIRS}")
  217. include_directories(${ADDITIONAL_INCLUDE_DIRS})
  218. endif(ADDITIONAL_INCLUDE_DIRS)
  219. if (ADDITIONAL_LINK_DIRS)
  220. message(STATUS "StoRM - Using additional link directories ${ADDITIONAL_LINK_DIRS}")
  221. link_directories(${ADDITIONAL_LINK_DIRS})
  222. endif(ADDITIONAL_LINK_DIRS)
  223. #############################################################
  224. ##
  225. ## Pre executable-creation link_directories setup
  226. ##
  227. #############################################################
  228. if (ENABLE_GUROBI)
  229. link_directories("${GUROBI_ROOT}/lib")
  230. endif()
  231. if ((NOT Boost_LIBRARY_DIRS) OR ("${Boost_LIBRARY_DIRS}" STREQUAL ""))
  232. set(Boost_LIBRARY_DIRS "${Boost_INCLUDE_DIRS}/stage/lib")
  233. endif ()
  234. link_directories(${Boost_LIBRARY_DIRS})
  235. if (TBB_FOUND AND USE_INTELTBB)
  236. link_directories(${TBB_LIBRARY_DIRS})
  237. endif()
  238. ###############################################################################
  239. ## #
  240. ## Executable Creation #
  241. ## #
  242. ## All link_directories() calls MUST be made before this point #
  243. ## #
  244. ###############################################################################
  245. add_executable(storm ${STORM_SOURCES} ${STORM_HEADERS} ${STORM_BUILD_HEADERS})
  246. add_executable(storm-functional-tests ${STORM_FUNCTIONAL_TEST_FILES} ${STORM_SOURCES_WITHOUT_MAIN} ${STORM_HEADERS} ${STORM_BUILD_HEADERS})
  247. add_executable(storm-performance-tests ${STORM_PERFORMANCE_TEST_FILES} ${STORM_SOURCES_WITHOUT_MAIN} ${STORM_HEADERS} ${STORM_BUILD_HEADERS})
  248. #############################################################
  249. ##
  250. ## Boost
  251. ##
  252. #############################################################
  253. include_directories(${Boost_INCLUDE_DIRS})
  254. target_link_libraries(storm ${Boost_LIBRARIES})
  255. target_link_libraries(storm-functional-tests ${Boost_LIBRARIES})
  256. target_link_libraries(storm-performance-tests ${Boost_LIBRARIES})
  257. #message(STATUS "BOOST_INCLUDE_DIRS is ${Boost_INCLUDE_DIRS}")
  258. #message(STATUS "BOOST_LIBRARY_DIRS is ${Boost_LIBRARY_DIRS}")
  259. #############################################################
  260. ##
  261. ## CUDD
  262. ##
  263. #############################################################
  264. add_subdirectory("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0")
  265. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/cudd")
  266. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/epd")
  267. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/mtr")
  268. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/nanotrav")
  269. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/obj")
  270. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/st")
  271. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/src/util")
  272. target_link_libraries(storm cudd)
  273. target_link_libraries(storm-functional-tests cudd)
  274. target_link_libraries(storm-performance-tests cudd)
  275. #############################################################
  276. ##
  277. ## LTL2DSTAR
  278. ##
  279. #############################################################
  280. add_subdirectory("${PROJECT_SOURCE_DIR}/resources/3rdparty/ltl2dstar-0.5.1")
  281. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/ltl2dstar-0.5.1/src")
  282. target_link_libraries(storm ltl2dstar)
  283. target_link_libraries(storm-functional-tests ltl2dstar)
  284. target_link_libraries(storm-performance-tests ltl2dstar)
  285. #############################################################
  286. ##
  287. ## Gurobi (optional)
  288. ##
  289. #############################################################
  290. if (ENABLE_GUROBI)
  291. message (STATUS "StoRM - Linking with Gurobi")
  292. include_directories("${GUROBI_ROOT}/include")
  293. target_link_libraries(storm "gurobi55")
  294. target_link_libraries(storm-functional-tests "gurobi55")
  295. target_link_libraries(storm-performance-tests "gurobi55")
  296. endif(ENABLE_GUROBI)
  297. #############################################################
  298. ##
  299. ## Google Test gtest
  300. ##
  301. #############################################################
  302. set(gtest_force_shared_crt ON)
  303. add_subdirectory("${PROJECT_SOURCE_DIR}/resources/3rdparty/gtest-1.7.0")
  304. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/gtest-1.7.0/include")
  305. enable_testing()
  306. target_link_libraries(storm-functional-tests gtest)
  307. target_link_libraries(storm-performance-tests gtest)
  308. add_test(NAME storm-functional-tests COMMAND storm-functional-tests)
  309. add_test(NAME storm-performance-tests COMMAND storm-performance-tests)
  310. #############################################################
  311. ##
  312. ## Log4CPlus
  313. ##
  314. #############################################################
  315. set(BUILD_SHARED_LIBS OFF CACHE BOOL "If TRUE, log4cplus is built as a shared library, otherwise as a static library")
  316. set(LOG4CPLUS_BUILD_TESTING NO)
  317. set(LOG4CPLUS_USE_UNICODE OFF)
  318. add_subdirectory("${PROJECT_SOURCE_DIR}/resources/3rdparty/log4cplus-1.1.2-rc2")
  319. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/log4cplus-1.1.2-rc2/include")
  320. include_directories("${PROJECT_BINARY_DIR}/resources/3rdparty/log4cplus-1.1.2-rc2/include") # This adds the defines.hxx file
  321. target_link_libraries(storm log4cplusS)
  322. target_link_libraries(storm-functional-tests log4cplusS)
  323. target_link_libraries(storm-performance-tests log4cplusS)
  324. if (UNIX AND NOT APPLE)
  325. target_link_libraries(storm rt)
  326. if (STORM_USE_COTIRE)
  327. target_link_libraries(storm_unity rt)
  328. endif(STORM_USE_COTIRE)
  329. target_link_libraries(storm-functional-tests rt)
  330. target_link_libraries(storm-performance-tests rt)
  331. endif(UNIX AND NOT APPLE)
  332. #############################################################
  333. ##
  334. ## Intel Threading Building Blocks (optional)
  335. ##
  336. #############################################################
  337. if (TBB_FOUND)
  338. message(STATUS "StoRM - Found Intel TBB with Interface Version ${TBB_INTERFACE_VERSION}")
  339. if (USE_INTELTBB)
  340. message(STATUS "StoRM - Linking with Intel TBB for activated Matrix/Vector MT")
  341. include_directories(${TBB_INCLUDE_DIRS})
  342. target_link_libraries(storm tbb tbbmalloc)
  343. target_link_libraries(storm-functional-tests tbb tbbmalloc)
  344. target_link_libraries(storm-performance-tests tbb tbbmalloc)
  345. endif(USE_INTELTBB)
  346. endif(TBB_FOUND)
  347. #############################################################
  348. ##
  349. ## Threads
  350. ##
  351. #############################################################
  352. include_directories(${THREADS_INCLUDE_DIRS})
  353. target_link_libraries(storm ${CMAKE_THREAD_LIBS_INIT})
  354. if (STORM_USE_COTIRE)
  355. target_link_libraries(storm_unity ${CMAKE_THREAD_LIBS_INIT})
  356. endif(STORM_USE_COTIRE)
  357. target_link_libraries(storm-functional-tests ${CMAKE_THREAD_LIBS_INIT})
  358. target_link_libraries(storm-performance-tests ${CMAKE_THREAD_LIBS_INIT})
  359. if (MSVC)
  360. # Add the DebugHelper DLL
  361. set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} Dbghelp.lib")
  362. target_link_libraries(storm "Dbghelp.lib")
  363. target_link_libraries(storm-functional-tests "Dbghelp.lib")
  364. target_link_libraries(storm-performance-tests "Dbghelp.lib")
  365. endif(MSVC)
  366. # Print Cotire Usage Status
  367. message (STATUS "StoRM - Using Cotire: ${STORM_USE_COTIRE}")
  368. if (STORM_USE_COTIRE)
  369. # Include Cotire for PCH Generation
  370. set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/resources/cmake")
  371. include(cotire)
  372. cotire(storm)
  373. target_link_libraries(storm_unity ${Boost_LIBRARIES})
  374. #cotire(storm-functional-tests)
  375. #cotire(storm-performance-tests)
  376. endif()
  377. # Link against libc++abi if requested. May be needed to build on Linux systems using clang.
  378. if (LINK_LIBCXXABI)
  379. message (STATUS "StoRM - Linking against libc++abi.")
  380. target_link_libraries(storm "c++abi")
  381. target_link_libraries(storm-functional-tests "c++abi")
  382. target_link_libraries(storm-performance-tests "c++abi")
  383. endif(LINK_LIBCXXABI)
  384. # Add a target to generate API documentation with Doxygen
  385. if(DOXYGEN_FOUND)
  386. set(CMAKE_DOXYGEN_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/doc")
  387. string(REGEX REPLACE ";" " " CMAKE_DOXYGEN_INPUT_LIST "${PROJECT_SOURCE_DIR}/src")
  388. configure_file("${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in" "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" @ONLY)
  389. add_custom_target(doc ${DOXYGEN_EXECUTABLE} "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" COMMENT "Generating API documentation with Doxygen" VERBATIM)
  390. endif(DOXYGEN_FOUND)
  391. 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)
  392. 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)
  393. 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)
  394. set (CPPLINT_ARGS --filter=-whitespace/tab,-whitespace/line_length,-legal/copyright,-readability/streams)
  395. add_custom_target(style python cpplint.py ${CPPLINT_ARGS} `find ./src/ -iname "*.h" -or -iname "*.cpp"`)