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.

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