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.

51 lines
2.1 KiB

  1. cmake_minimum_required(VERSION 3.0.0)
  2. project(pystorm)
  3. find_package(storm REQUIRED)
  4. add_subdirectory(resources/pybind11)
  5. option(STORMPY_DISABLE_SIGNATURE_DOC "Disable the signature in the documentation" OFF)
  6. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
  7. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/generated/config.h)
  8. message(STATUS "STORM-DIR: ${storm_DIR}")
  9. message(STATUS "STORM-INCLUDE-DIR: ${storm_INCLUDE_DIR}")
  10. function(stormpy_module NAME)
  11. # second, optional argument are ADDITIONAL_LIBRARIES
  12. # third, optional argument are ADDITIONAL_INCLUDES
  13. file(GLOB_RECURSE "STORM_${NAME}_SOURCES" "${CMAKE_CURRENT_SOURCE_DIR}/src/${NAME}/*.cpp")
  14. pybind11_add_module(${NAME} "${CMAKE_CURRENT_SOURCE_DIR}/src/mod_${NAME}.cpp" ${STORM_${NAME}_SOURCES})
  15. if(ARGC GREATER 1)
  16. # Additional libraries
  17. target_include_directories(${NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${storm_INCLUDE_DIR} ${storm-parsers_INCLUDE_DIR} ${storm-counterexamples_INCLUDE_DIR} ${storm-version-info_INCLUDE_DIR} ${ARGV2} ${CMAKE_CURRENT_BINARY_DIR}/src/generated)
  18. target_link_libraries(${NAME} PRIVATE storm storm-parsers storm-counterexamples storm-version-info ${ARGV1})
  19. else()
  20. target_include_directories(${NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${storm_INCLUDE_DIR} ${storm-parsers_INCLUDE_DIR} ${storm-counterexamples_INCLUDE_DIR} ${storm-version-info_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src/generated)
  21. target_link_libraries(${NAME} PRIVATE storm storm-parsers storm-counterexamples storm-version-info )
  22. endif()
  23. endfunction(stormpy_module)
  24. stormpy_module(core)
  25. stormpy_module(info)
  26. stormpy_module(logic)
  27. stormpy_module(storage)
  28. stormpy_module(utility)
  29. # Optional modules
  30. if(HAVE_STORM_DFT)
  31. stormpy_module(dft storm-dft "${storm-dft_INCLUDE_DIR}")
  32. endif()
  33. if(HAVE_STORM_GSPN)
  34. stormpy_module(gspn storm-gspn "${storm-gspn_INCLUDE_DIR}")
  35. endif()
  36. if(HAVE_STORM_PARS)
  37. stormpy_module(pars storm-pars "${storm-pars_INCLUDE_DIR}")
  38. endif()
  39. if(HAVE_STORM_POMDP)
  40. stormpy_module(pomdp storm-pomdp "${storm-pomdp_INCLUDE_DIR}")
  41. endif()