Browse Source

Update CMake files for stormpy

Former-commit-id: 403fa972be
tempestpy_adaptions
hbruintjes 9 years ago
committed by Matthias Volk
parent
commit
46e305cd89
  1. 39
      stormpy/CMakeLists.txt
  2. 52
      stormpy/src/CMakeLists.txt

39
stormpy/CMakeLists.txt

@ -0,0 +1,39 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT("stormpy")
SET(STORMPY_OUTPUT_DIR "${PROJECT_BINARY_DIR}/stormpy")
FIND_PACKAGE ( PythonInterp REQUIRED )
FIND_PACKAGE ( PythonLibs REQUIRED )
file(STRINGS "${PROJECT_SOURCE_DIR}/setup.cfg" include_dirs
REGEX "^include_dirs=.*$")
string(REGEX REPLACE "^include_dirs=(.+)$" "\\1" include_dirs "${include_dirs}")
string(REPLACE ":" ";" include_dirs ${include_dirs})
file(STRINGS "${PROJECT_SOURCE_DIR}/setup.cfg" library_dirs
REGEX "^library_dirs=.*$")
string(REGEX REPLACE "^library_dirs=(.+)$" "\\1" library_dirs "${library_dirs}")
string(REPLACE ":" ";" library_dirs ${library_dirs})
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/resources/pybind11/include ${include_dirs} ${PYTHON_INCLUDE_DIRS})
LINK_DIRECTORIES(${library_dirs})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
ADD_SUBDIRECTORY( src )
add_custom_target(stormpy_files)
add_custom_command(TARGET stormpy_files POST_BUILD COMMAND ${CMAKE_COMMAND} -E
copy_directory ${CMAKE_SOURCE_DIR}/lib/stormpy ${STORMPY_OUTPUT_DIR}
)
add_custom_target(stormpy DEPENDS
stormpy_files
stormpy_core
stormpy_info
stormpy_expressions
stormpy_storage
stormpy_logic
)

52
stormpy/src/CMakeLists.txt

@ -4,12 +4,15 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src ${stormpy_INCLUDE_DIRS} ${PYTHON_I
INCLUDE_DIRECTORIES(${pybind11_incdir})
FILE(GLOB core_files "core/*.cpp")
FILE(GLOB info_files "info/*.cpp")
#FILE(GLOB info_files "info/*.cpp")
#FILE(GLOB expressions_files "expressions/*.cpp")
FILE(GLOB storage_files "storage/*.cpp")
FILE(GLOB logic_files "logic/*.cpp")
ADD_LIBRARY(stormpy_core SHARED mod_core.cpp ${core_files})
ADD_LIBRARY(stormpy_info SHARED mod_info.cpp ${info_files})
SET(STORMPY_SOURCE_DIR "${PROJECT_SOURCE_DIR}")
SET(STORMPY_OUTPUT_DIR "${PROJECT_BINARY_DIR}/stormpy")
ADD_LIBRARY(stormpy_info SHARED mod_info.cpp)
ADD_LIBRARY(stormpy_expressions SHARED mod_expressions.cpp)
ADD_LIBRARY(stormpy_storage SHARED mod_storage.cpp ${storage_files})
ADD_LIBRARY(stormpy_logic SHARED mod_logic.cpp ${logic_files})
SET_TARGET_PROPERTIES(stormpy_core PROPERTIES
OUTPUT_NAME core
@ -25,18 +28,29 @@ SET_TARGET_PROPERTIES(stormpy_info PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${STORMPY_OUTPUT_DIR}/info
)
add_custom_target(stormpy_files)
add_custom_command(TARGET stormpy_files POST_BUILD COMMAND ${CMAKE_COMMAND} -E
copy_directory ${CMAKE_SOURCE_DIR}/stormpy ${STORMPY_OUTPUT_DIR}
)
if(BUILD_STATIC)
TARGET_LINK_LIBRARIES(stormpy_core lib_storm_static ${stormpy_LIBRARIES_STATIC} ${PYTHON_LIBRARIES} ${libs_static} )
TARGET_LINK_LIBRARIES(stormpy_info lib_storm_static ${stormpy_LIBRARIES_STATIC} ${PYTHON_LIBRARIES} ${libs_static} )
else()
TARGET_LINK_LIBRARIES(stormpy_core lib_storm ${stormpy_LIBRARIES_DYNAMIC} ${PYTHON_LIBRARIES} ${libs_dynamic})
TARGET_LINK_LIBRARIES(stormpy_info lib_storm ${stormpy_LIBRARIES_DYNAMIC} ${PYTHON_LIBRARIES} ${libs_dynamic})
endif()
#
add_custom_target(stormpy DEPENDS stormpy_files stormpy_core stormpy_info)
SET_TARGET_PROPERTIES(stormpy_expressions PROPERTIES
OUTPUT_NAME expressions
PREFIX ""
SUFFIX ".so"
LIBRARY_OUTPUT_DIRECTORY ${STORMPY_OUTPUT_DIR}/expressions
)
SET_TARGET_PROPERTIES(stormpy_storage PROPERTIES
OUTPUT_NAME storage
PREFIX ""
SUFFIX ".so"
LIBRARY_OUTPUT_DIRECTORY ${STORMPY_OUTPUT_DIR}/storage
)
SET_TARGET_PROPERTIES(stormpy_logic PROPERTIES
OUTPUT_NAME logic
PREFIX ""
SUFFIX ".so"
LIBRARY_OUTPUT_DIRECTORY ${STORMPY_OUTPUT_DIR}/logic
)
TARGET_LINK_LIBRARIES(stormpy_core storm ${PYTHON_LIBRARIES})
TARGET_LINK_LIBRARIES(stormpy_info storm ${PYTHON_LIBRARIES})
TARGET_LINK_LIBRARIES(stormpy_expressions storm ${PYTHON_LIBRARIES})
TARGET_LINK_LIBRARIES(stormpy_storage storm ${PYTHON_LIBRARIES})
TARGET_LINK_LIBRARIES(stormpy_logic storm ${PYTHON_LIBRARIES})
Loading…
Cancel
Save