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.

401 lines
19 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. # Set all GTest references to the version in the repository and show it as output
  8. set (GTEST_INCLUDE_DIR resources/3rdparty/gtest-1.6.0/include)
  9. if(MSVC)
  10. set (STORM_LIB_SUFFIX lib)
  11. set (GTEST_LIBRARY_DEBUG ${PROJECT_SOURCE_DIR}/resources/3rdparty/gtest-1.6.0/build/Debug/gtest.${STORM_LIB_SUFFIX})
  12. set (GTEST_MAIN_LIBRARY_DEBUG ${PROJECT_SOURCE_DIR}/resources/3rdparty/gtest-1.6.0/build/Debug/gtest_main.${STORM_LIB_SUFFIX})
  13. set (GTEST_LIBRARY ${PROJECT_SOURCE_DIR}/resources/3rdparty/gtest-1.6.0/build/Release/gtest.${STORM_LIB_SUFFIX})
  14. set (GTEST_MAIN_LIBRARY ${PROJECT_SOURCE_DIR}/resources/3rdparty/gtest-1.6.0/build/Release/gtest_main.${STORM_LIB_SUFFIX})
  15. set (GTEST_LIBRARIES optimized ${GTEST_LIBRARY} debug ${GTEST_LIBRARY_DEBUG})
  16. else()
  17. set (STORM_LIB_SUFFIX a)
  18. set (GTEST_LIBRARY ${PROJECT_SOURCE_DIR}/resources/3rdparty/gtest-1.6.0/libgtest.${STORM_LIB_SUFFIX})
  19. set (GTEST_MAIN_LIBRARY ${PROJECT_SOURCE_DIR}/resources/3rdparty/gtest-1.6.0/libgtest_main.${STORM_LIB_SUFFIX})
  20. set (GTEST_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY}) # as we dont use FindGTest anymore
  21. endif()
  22. message(STATUS "GTEST_INCLUDE_DIR is ${GTEST_INCLUDE_DIR}")
  23. message(STATUS "GTEST_LIBRARY is ${GTEST_LIBRARY}")
  24. message(STATUS "GTEST_MAIN_LIBRARY is ${GTEST_MAIN_LIBRARY}")
  25. # Set all log4cplus references the version in the repository
  26. set (LOG4CPLUS_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/resources/3rdparty/log4cplus-1.1.0/include)
  27. if (MSVC)
  28. set (LOG4CPLUS_LIBRARIES optimized ${PROJECT_SOURCE_DIR}/resources/3rdparty/log4cplus-1.1.0/msvc10/x64/bin.Release/log4cplusS.${STORM_LIB_SUFFIX} debug ${PROJECT_SOURCE_DIR}/resources/3rdparty/log4cplus-1.1.0/msvc10/x64/bin.Debug/log4cplusSD.${STORM_LIB_SUFFIX})
  29. else()
  30. set (LOG4CPLUS_LIBRARIES ${PROJECT_SOURCE_DIR}/resources/3rdparty/log4cplus-1.1.0/src/liblog4cplus.${STORM_LIB_SUFFIX})
  31. endif()
  32. message(STATUS "LOG4CPLUS_INCLUDE_DIR is ${LOG4CPLUS_INCLUDE_DIR}")
  33. message(STATUS "LOG4CPLUS_LIBRARY is ${LOG4CPLUS_LIBRARIES}")
  34. # Set all Eigen references the version in the repository
  35. set(EIGEN3_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/resources/3rdparty/eigen)
  36. message(STATUS "EIGEN3_INCLUDE_DIR is ${EIGEN3_INCLUDE_DIR}")
  37. # Set all Eigen references the version in the repository
  38. set(GMMXX_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/resources/3rdparty/gmm-4.2/include)
  39. message(STATUS "GMMXX_INCLUDE_DIR is ${GMMXX_INCLUDE_DIR}")
  40. # Set all CUDD references to the version in the repository
  41. set(CUDD_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/include ${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/obj ${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/cudd ${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/mtr ${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/epd)
  42. set(CUDD_LIBRARY_DIRS ${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/cudd ${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/mtr ${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/util ${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/st ${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/epd ${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/obj)
  43. message(STATUS "CUDD_INCLUDE_DIRS is ${CUDD_INCLUDE_DIRS}")
  44. message(STATUS "CUDD_LIBRARY_DIRS is ${CUDD_LIBRARY_DIRS}")
  45. #Set all ltl2dstar references to the verion in the repository
  46. #set(LTL2DSTAR_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/resources/3rdparty/ltl2dstar-0.5.1/src)
  47. #set(LTL2DSTAR_LIBRARY_DIRS ${PROJECT_SOURCE_DIR}/resources/3rdparty/ltl2dstar-0.5.1/src)
  48. #message(STATUS "LTL2DSTAR_INCLUDE_DIRS is ${LTL2DSTAR_INCLUDE_DIRS}")
  49. #message(STATUS "LTL2DSTAR_LIBRARY_DIRS is ${LTL2DSTAR_LIBRARY_DIRS}")
  50. # Now define all available custom options
  51. option(DEBUG "Sets whether the DEBUG mode is used" ON)
  52. option(USE_POPCNT "Sets whether the popcnt instruction is going to be used." ON)
  53. option(USE_BOOST_STATIC_LIBRARIES "Sets whether the Boost libraries should be linked statically." ON)
  54. option(USE_INTELTBB "Sets whether the Intel TBB Extensions should be used." OFF)
  55. option(STORM_USE_COTIRE "Sets whether Cotire should be used (for building precompiled headers)." OFF)
  56. option(LINK_LIBCXXABI "Sets whether libc++abi should be linked" OFF)
  57. set(ADDITIONAL_INCLUDE_DIRS "" CACHE STRING "Additional directories added to the include directories.")
  58. set(ADDITIONAL_LINK_DIRS "" CACHE STRING "Additional directories added to the link directories.")
  59. set(CUSTOM_BOOST_ROOT "" CACHE STRING "A custom path to the Boost root directory.")
  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. message(STATUS "Building DEBUG version.")
  64. else()
  65. set (CMAKE_BUILD_TYPE "RELEASE")
  66. message(STATUS "Building RELEASE version.")
  67. endif()
  68. message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
  69. message(STATUS "CMAKE_BUILD_TYPE (ENV): $ENV{CMAKE_BUILD_TYPE}")
  70. if(CMAKE_COMPILER_IS_GNUCC)
  71. message(STATUS "Using GCC")
  72. # Set standard flags for GCC
  73. set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -funroll-loops")
  74. set (CMAKE_CXX_FLAGS "-std=c++0x -Wall -pedantic")
  75. # -Werror is atm removed as this gave some problems with existing code
  76. # May be re-set later
  77. # (Thomas Heinemann, 2012-12-21)
  78. # Turn on popcnt instruction if desired (yes by default)
  79. if (USE_POPCNT)
  80. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcnt")
  81. endif(USE_POPCNT)
  82. elseif(MSVC)
  83. message(STATUS "Using MSVC")
  84. # required for GMM to compile, ugly error directive in their code
  85. add_definitions(/D_SCL_SECURE_NO_DEPRECATE)
  86. # 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)
  87. add_definitions(/bigobj)
  88. else(CLANG)
  89. message(STATUS "Using CLANG")
  90. # As CLANG is not set as a variable, we need to set it in case we have not matched another compiler.
  91. set (CLANG ON)
  92. # Set standard flags for clang
  93. set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -funroll-loops -O3")
  94. set (CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ -Wall -Werror -pedantic -Wno-unused-variable -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE")
  95. set (CMAKE_CXX_FLAGS_DEBUG "-g")
  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. endif()
  101. # Add the binary folder to the search path for include files so that we will find storm-config.h
  102. include_directories("${PROJECT_BINARY_DIR}")
  103. # Base path for test files
  104. set(STORM_CPP_TESTS_BASE_PATH ${PROJECT_SOURCE_DIR}/test)
  105. message(STATUS "STORM_CPP_TESTS_BASE_PATH is ${STORM_CPP_TESTS_BASE_PATH}")
  106. # Main Sources
  107. file(GLOB_RECURSE STORM_HEADERS ${PROJECT_SOURCE_DIR}/src/*.h)
  108. file(GLOB_RECURSE STORM_SOURCES_WITHOUT_MAIN ${PROJECT_SOURCE_DIR}/src/*/*.cpp)
  109. file(GLOB_RECURSE STORM_MAIN_FILE ${PROJECT_SOURCE_DIR}/src/storm.cpp)
  110. set(STORM_SOURCES "${STORM_SOURCES_WITHOUT_MAIN};${STORM_MAIN_FILE}")
  111. file(GLOB_RECURSE STORM_ADAPTERS_FILES ${PROJECT_SOURCE_DIR}/src/adapters/*.h ${PROJECT_SOURCE_DIR}/src/adapters/*.cpp)
  112. file(GLOB_RECURSE STORM_EXCEPTIONS_FILES ${PROJECT_SOURCE_DIR}/src/exceptions/*.h ${PROJECT_SOURCE_DIR}/src/exceptions/*.cpp)
  113. file(GLOB STORM_FORMULA_FILES ${PROJECT_SOURCE_DIR}/src/formula/*.h ${PROJECT_SOURCE_DIR}/src/formula/*.cpp)
  114. file(GLOB_RECURSE STORM_FORMULA_ABSTRACT_FILES ${PROJECT_SOURCE_DIR}/src/formula/abstract/*.h ${PROJECT_SOURCE_DIR}/src/formula/abstract/*.cpp)
  115. file(GLOB_RECURSE STORM_FORMULA_CSL_FILES ${PROJECT_SOURCE_DIR}/src/formula/Csl/*.h ${PROJECT_SOURCE_DIR}/src/formula/Csl/*.cpp)
  116. file(GLOB_RECURSE STORM_FORMULA_LTL_FILES ${PROJECT_SOURCE_DIR}/src/formula/Ltl/*.h ${PROJECT_SOURCE_DIR}/src/formula/Ltl/*.cpp)
  117. file(GLOB_RECURSE STORM_FORMULA_PRCTL_FILES ${PROJECT_SOURCE_DIR}/src/formula/Prctl/*.h ${PROJECT_SOURCE_DIR}/src/formula/Prctl/*.cpp)
  118. file(GLOB_RECURSE STORM_MODELCHECKER_FILES ${PROJECT_SOURCE_DIR}/src/modelchecker/*.h ${PROJECT_SOURCE_DIR}/src/modelchecker/*.cpp)
  119. file(GLOB_RECURSE STORM_MODELS_FILES ${PROJECT_SOURCE_DIR}/src/models/*.h ${PROJECT_SOURCE_DIR}/src/models/*.cpp)
  120. file(GLOB STORM_PARSER_FILES ${PROJECT_SOURCE_DIR}/src/parser/*.h ${PROJECT_SOURCE_DIR}/src/parser/*.cpp)
  121. file(GLOB_RECURSE STORM_PARSER_PRISMPARSER_FILES ${PROJECT_SOURCE_DIR}/src/parser/prismparser/*.h ${PROJECT_SOURCE_DIR}/src/parser/prismparser/*.cpp)
  122. file(GLOB_RECURSE STORM_STORAGE_FILES ${PROJECT_SOURCE_DIR}/src/storage/*.h ${PROJECT_SOURCE_DIR}/src/storage/*.cpp)
  123. file(GLOB_RECURSE STORM_UTILITY_FILES ${PROJECT_SOURCE_DIR}/src/utility/*.h ${PROJECT_SOURCE_DIR}/src/utility/*.cpp)
  124. file(GLOB STORM_IR_FILES ${PROJECT_SOURCE_DIR}/src/ir/*.h ${PROJECT_SOURCE_DIR}/src/ir/*.cpp)
  125. file(GLOB_RECURSE STORM_IR_EXPRESSIONS_FILES ${PROJECT_SOURCE_DIR}/src/ir/expressions/*.h ${PROJECT_SOURCE_DIR}/src/ir/expressions/*.cpp)
  126. file(GLOB_RECURSE STORM_SOLVER_FILES ${PROJECT_SOURCE_DIR}/src/solver/*.h ${PROJECT_SOURCE_DIR}/src/solver/*.cpp)
  127. # Test Sources
  128. # Note that the tests also need the source files, except for the main file
  129. file(GLOB_RECURSE STORM_FUNCTIONAL_TEST_FILES ${STORM_CPP_TESTS_BASE_PATH}/functional/*.h ${STORM_CPP_TESTS_BASE_PATH}/functional/*.cpp)
  130. file(GLOB_RECURSE STORM_PERFORMANCE_TEST_FILES ${STORM_CPP_TESTS_BASE_PATH}/performance/*.h ${STORM_CPP_TESTS_BASE_PATH}/performance/*.cpp)
  131. # Group the headers and sources
  132. source_group(main FILES ${STORM_MAIN_FILE})
  133. source_group(adapters FILES ${STORM_ADAPTERS_FILES})
  134. source_group(exceptions FILES ${STORM_EXCEPTIONS_FILES})
  135. source_group(formula FILES ${STORM_FORMULA_FILES})
  136. source_group(formula\\abstract FILES ${STORM_FORMULA_ABSTRACT_FILES})
  137. source_group(formula\\csl FILES ${STORM_FORMULA_CSL_FILES})
  138. source_group(formula\\ltl FILES ${STORM_FORMULA_LTL_FILES})
  139. source_group(formula\\prctl FILES ${STORM_FORMULA_PRCTL_FILES})
  140. source_group(modelchecker FILES ${STORM_MODELCHECKER_FILES})
  141. source_group(models FILES ${STORM_MODELS_FILES})
  142. source_group(parser FILES ${STORM_PARSER_FILES})
  143. source_group(parser\\prismparser FILES ${STORM_PARSER_PRISMPARSER_FILES})
  144. source_group(storage FILES ${STORM_STORAGE_FILES})
  145. source_group(utility FILES ${STORM_UTILITY_FILES})
  146. source_group(ir FILES ${STORM_IR_FILES})
  147. source_group(ir\\expressions FILES ${STORM_IR_EXPRESSIONS_FILES})
  148. source_group(solver FILES ${STORM_SOLVER_FILES})
  149. source_group(functional-test FILES ${STORM_FUNCTIONAL_TEST_FILES})
  150. source_group(performance-test FILES ${STORM_PERFORMANCE_TEST_FILES})
  151. # Add base folder for better inclusion paths
  152. include_directories("${PROJECT_SOURCE_DIR}")
  153. include_directories("${PROJECT_SOURCE_DIR}/src")
  154. # Preset pathes for Intel TBB to internal copy in /resources/3rdParty/tbb41_20130314_mergedWindowsLinuxMacOSX
  155. set(TBB_INSTALL_DIR "${PROJECT_SOURCE_DIR}/resources/3rdparty/tbb41_20130314_merged-win-lin-mac/")
  156. if(MSVC)
  157. set(ENV{TBB_ARCH_PLATFORM} "intel64/vc11")
  158. elseif(CMAKE_COMPILER_IS_GNUCC)
  159. set(ENV{TBB_ARCH_PLATFORM} "intel64/gcc4.4")
  160. else(CLANG)
  161. set(ENV{TBB_ARCH_PLATFORM} "intel64/clang3.2")
  162. endif()
  163. # Add the resources/cmake folder to Module Search Path for FindTBB.cmake
  164. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/resources/cmake/")
  165. # Set required external packages
  166. find_package(Threads REQUIRED)
  167. find_package(Doxygen REQUIRED)
  168. set(Boost_USE_STATIC_LIBS ON)
  169. set(Boost_USE_MULTITHREADED ON)
  170. set(Boost_USE_STATIC_RUNTIME OFF)
  171. # If a custom boost root directory was specified, we set the corresponding hint for the script to find it.
  172. if(CUSTOM_BOOST_ROOT)
  173. set(BOOST_ROOT "${CUSTOM_BOOST_ROOT}")
  174. endif(CUSTOM_BOOST_ROOT)
  175. find_package(Boost REQUIRED COMPONENTS program_options)
  176. find_package(TBB)
  177. if(Boost_FOUND)
  178. if ((NOT Boost_LIBRARY_DIRS) OR ("${Boost_LIBRARY_DIRS}" STREQUAL ""))
  179. set(Boost_LIBRARY_DIRS "${Boost_INCLUDE_DIRS}/stage/lib")
  180. endif ()
  181. message(STATUS "BOOST_INCLUDE_DIRS is ${Boost_INCLUDE_DIRS}")
  182. message(STATUS "BOOST_LIBRARY_DIRS is ${Boost_LIBRARY_DIRS}")
  183. include_directories(${Boost_INCLUDE_DIRS})
  184. link_directories(${Boost_LIBRARY_DIRS})
  185. endif(Boost_FOUND)
  186. # Intels Thread Building Blocks
  187. if (TBB_FOUND)
  188. message(STATUS "Found TBB with Interface Version ${TBB_INTERFACE_VERSION}")
  189. if(USE_INTELTBB)
  190. add_definitions(-DSTORM_USE_TBB)
  191. include_directories(${TBB_INCLUDE_DIRS})
  192. link_directories(${TBB_LIBRARY_DIRS})
  193. endif()
  194. endif(TBB_FOUND)
  195. # Add Eigen to the included directories
  196. include_directories(${EIGEN3_INCLUDE_DIR})
  197. # Add GMMXX to the included directories
  198. include_directories(${GMMXX_INCLUDE_DIR})
  199. # Add custom additional include or link directories
  200. if (ADDITIONAL_INCLUDE_DIRS)
  201. message(STATUS "Using additional include directories ${ADDITIONAL_INCLUDE_DIRS}")
  202. include_directories(${ADDITIONAL_INCLUDE_DIRS})
  203. endif(ADDITIONAL_INCLUDE_DIRS)
  204. if (ADDITIONAL_LINK_DIRS)
  205. message(STATUS "Using additional link directories ${ADDITIONAL_LINK_DIRS}")
  206. link_directories(${ADDITIONAL_LINK_DIRS})
  207. endif(ADDITIONAL_LINK_DIRS)
  208. if (CUDD_INCLUDE_DIRS)
  209. include_directories(${CUDD_INCLUDE_DIRS})
  210. endif(CUDD_INCLUDE_DIRS)
  211. if (CUDD_LIBRARY_DIRS)
  212. link_directories(${CUDD_LIBRARY_DIRS})
  213. endif(CUDD_LIBRARY_DIRS)
  214. if (LTL2DSTAR_INCLUDE_DIRS)
  215. include_directories(${LTL2DSTAR_INCLUDE_DIRS})
  216. endif(LTL2DSTAR_INCLUDE_DIRS)
  217. if (LTL2DSTAR_LIBRARY_DIRS)
  218. link_directories(${LTL2DSTAR_LIBRARY_DIRS})
  219. endif(LTL2DSTAR_LIBRARY_DIRS)
  220. # Add the executables
  221. # Must be created *after* Boost was added because of LINK_DIRECTORIES
  222. add_executable(storm ${STORM_SOURCES} ${STORM_HEADERS})
  223. add_executable(storm-functional-tests ${STORM_FUNCTIONAL_TEST_FILES} ${STORM_SOURCES_WITHOUT_MAIN} ${STORM_HEADERS})
  224. add_executable(storm-performance-tests ${STORM_PERFORMANCE_TEST_FILES} ${STORM_SOURCES_WITHOUT_MAIN} ${STORM_HEADERS})
  225. # Add target link deps for Boost program options
  226. target_link_libraries(storm ${Boost_LIBRARIES})
  227. target_link_libraries(storm-functional-tests ${Boost_LIBRARIES})
  228. target_link_libraries(storm-performance-tests ${Boost_LIBRARIES})
  229. if (MSVC)
  230. # Add the DebugHelper DLL
  231. set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} Dbghelp.lib")
  232. target_link_libraries(storm "Dbghelp.lib")
  233. target_link_libraries(storm-functional-tests "Dbghelp.lib")
  234. target_link_libraries(storm-performance-tests "Dbghelp.lib")
  235. endif(MSVC)
  236. if (USE_INTELTBB)
  237. target_link_libraries(storm tbb tbbmalloc)
  238. target_link_libraries(storm-functional-tests tbb tbbmalloc)
  239. target_link_libraries(storm-performance-tests tbb tbbmalloc)
  240. endif(USE_INTELTBB)
  241. if (APPLE)
  242. set(STORM_USE_COTIRE OFF)
  243. # Set up some Xcode specific settings
  244. set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
  245. set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
  246. endif(APPLE)
  247. # Print Cotire Usage Status
  248. message (STATUS "Using Cotire: ${STORM_USE_COTIRE}")
  249. if (STORM_USE_COTIRE)
  250. # Include Cotire for PCH Generation
  251. set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/resources/cmake")
  252. include(cotire)
  253. cotire(storm)
  254. target_link_libraries(storm_unity ${Boost_LIBRARIES})
  255. #cotire(storm-functional-tests)
  256. #cotire(storm-performance-tests)
  257. endif()
  258. # Link against libc++abi if requested. May be needed to build on Linux systems using clang.
  259. if (LINK_LIBCXXABI)
  260. message (STATUS "Linking against libc++abi.")
  261. target_link_libraries(storm "c++abi")
  262. target_link_libraries(storm-functional-tests "c++abi")
  263. target_link_libraries(storm-performance-tests "c++abi")
  264. endif(LINK_LIBCXXABI)
  265. # Add a target to generate API documentation with Doxygen
  266. if(DOXYGEN_FOUND)
  267. set(CMAKE_DOXYGEN_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/doc")
  268. string(REGEX REPLACE ";" " " CMAKE_DOXYGEN_INPUT_LIST "${PROJECT_SOURCE_DIR}/src")
  269. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
  270. add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile COMMENT "Generating API documentation with Doxygen" VERBATIM)
  271. endif(DOXYGEN_FOUND)
  272. if (GTEST_INCLUDE_DIR)
  273. # For make-based builds, defines make target named test.
  274. # For Visual Studio builds, defines Visual Studio project named RUN_TESTS.
  275. enable_testing()
  276. include_directories(${GTEST_INCLUDE_DIR})
  277. target_link_libraries(storm-functional-tests ${GTEST_LIBRARIES})
  278. target_link_libraries(storm-performance-tests ${GTEST_LIBRARIES})
  279. add_test(NAME storm-functional-tests COMMAND storm-functional-tests)
  280. add_test(NAME storm-performance-tests COMMAND storm-performance-tests)
  281. if(MSVC) # VS2012 doesn't support correctly the tuples yet
  282. add_definitions( /D _VARIADIC_MAX=10 )
  283. endif()
  284. endif(GTEST_INCLUDE_DIR)
  285. if (LOG4CPLUS_INCLUDE_DIR)
  286. include_directories(${LOG4CPLUS_INCLUDE_DIR})
  287. target_link_libraries(storm ${LOG4CPLUS_LIBRARIES})
  288. if (STORM_USE_COTIRE)
  289. target_link_libraries(storm_unity ${LOG4CPLUS_LIBRARIES})
  290. endif(STORM_USE_COTIRE)
  291. target_link_libraries(storm-functional-tests ${LOG4CPLUS_LIBRARIES})
  292. target_link_libraries(storm-performance-tests ${LOG4CPLUS_LIBRARIES})
  293. # On Linux, we have to link against librt
  294. if (UNIX AND NOT APPLE)
  295. target_link_libraries(storm rt)
  296. if (STORM_USE_COTIRE)
  297. target_link_libraries(storm_unity rt)
  298. endif(STORM_USE_COTIRE)
  299. target_link_libraries(storm-functional-tests rt)
  300. target_link_libraries(storm-performance-tests rt)
  301. endif(UNIX AND NOT APPLE)
  302. endif(LOG4CPLUS_INCLUDE_DIR)
  303. if (CUDD_LIBRARY_DIRS)
  304. if (MSVC)
  305. set(cuddMsvcLibs "optimized" "${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/CUDD_Win32/x64/Release/CUDD_Win32.lib" "debug" "${PROJECT_SOURCE_DIR}/resources/3rdparty/cudd-2.5.0/CUDD_Win32/x64/Debug/CUDD_Win32.lib")
  306. target_link_libraries(storm ${cuddMsvcLibs})
  307. target_link_libraries(storm-functional-tests ${cuddMsvcLibs})
  308. target_link_libraries(storm-performance-tests ${cuddMsvcLibs})
  309. else ()
  310. target_link_libraries(storm "-lobj -lcudd -lmtr -lst -lutil -lepd")
  311. target_link_libraries(storm-functional-tests "-lobj -lcudd -lmtr -lst -lutil -lepd")
  312. target_link_libraries(storm-performance-tests "-lobj -lcudd -lmtr -lst -lutil -lepd")
  313. endif ()
  314. endif(CUDD_LIBRARY_DIRS)
  315. if (LTL2DSTAR_LIBRARY_DIRS)
  316. if (MSVC)
  317. #TODO
  318. else ()
  319. target_link_libraries(storm "-lltl2dstar")
  320. target_link_libraries(storm-functional-tests "-lltl2dstar")
  321. target_link_libraries(storm-performance-tests "-lltl2dstar")
  322. endif ()
  323. endif (LTL2DSTAR_LIBRARY_DIRS)
  324. if (THREADS_FOUND)
  325. include_directories(${THREADS_INCLUDE_DIRS})
  326. target_link_libraries(storm ${CMAKE_THREAD_LIBS_INIT})
  327. if (STORM_USE_COTIRE)
  328. target_link_libraries(storm_unity ${CMAKE_THREAD_LIBS_INIT})
  329. endif(STORM_USE_COTIRE)
  330. target_link_libraries(storm-functional-tests ${CMAKE_THREAD_LIBS_INIT})
  331. target_link_libraries(storm-performance-tests ${CMAKE_THREAD_LIBS_INIT})
  332. endif(THREADS_FOUND)
  333. # Configure a header file to pass some of the CMake settings to the source code
  334. configure_file (
  335. "${PROJECT_SOURCE_DIR}/storm-config.h.in"
  336. "${PROJECT_BINARY_DIR}/storm-config.h"
  337. )
  338. 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)
  339. 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)
  340. 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)
  341. set (CPPLINT_ARGS --filter=-whitespace/tab,-whitespace/line_length,-legal/copyright,-readability/streams)
  342. add_custom_target(style python cpplint.py ${CPPLINT_ARGS} `find ./src/ -iname "*.h" -or -iname "*.cpp"`)