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.

42 lines
1.6 KiB

  1. cmake_minimum_required(VERSION 3.0.0)
  2. project(pystorm)
  3. option(STORMPY_DISABLE_SIGNATURE_DOC "disables the signature in the documentation" ON)
  4. find_package(storm REQUIRED)
  5. add_subdirectory(resources/pybind11)
  6. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/generated/config.h)
  7. set(STORMPY_LIB_DIR "${CMAKE_SOURCE_DIR}/lib/stormpy" CACHE STRING "Sets the storm library dir")
  8. function(stormpy_module NAME)
  9. # second, optional argument is LIBRARY_OUTPUT_DIRECTORY,
  10. # defaults to subdir with module name
  11. if(ARGC GREATER 1)
  12. set(LIB_PATH "${ARGV1}")
  13. else()
  14. set(LIB_PATH "${STORMPY_LIB_DIR}/${NAME}")
  15. endif()
  16. file(GLOB_RECURSE "STORM_${NAME}_SOURCES" "${CMAKE_CURRENT_SOURCE_DIR}/src/${NAME}/*.cpp")
  17. pybind11_add_module(${NAME} "${CMAKE_CURRENT_SOURCE_DIR}/src/mod_${NAME}.cpp" ${STORM_${NAME}_SOURCES})
  18. target_include_directories(${NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${storm_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src/generated)
  19. target_link_libraries(${NAME} PRIVATE storm)
  20. # setup.py will override this (because pip may want a different install
  21. # path), but also specifying it here has the advantage that invoking cmake
  22. # manually uses the correct path if the default is used (i.e. the
  23. # STORMPY_LIB_DIR hardcoded above)
  24. set_target_properties(${NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${LIB_PATH}")
  25. endfunction(stormpy_module)
  26. stormpy_module(core "${STORMPY_LIB_DIR}")
  27. stormpy_module(info)
  28. stormpy_module(expressions)
  29. stormpy_module(logic)
  30. stormpy_module(storage)
  31. stormpy_module(utility)