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.

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