Mavo
8 years ago
committed by
Matthias Volk
4 changed files with 56 additions and 64 deletions
@ -1,39 +1,42 @@ |
|||
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} |
|||
find_package(PythonInterp REQUIRED) |
|||
find_package(PythonLibs REQUIRED) |
|||
|
|||
set(STORMPY_OUTPUT_DIR "${PROJECT_BINARY_DIR}/stormpy") |
|||
set(STORMPY_SOURCE_DIR "${PROJECT_SOURCE_DIR}/stormpy") |
|||
|
|||
if(STORM_HAVE_CLN) |
|||
set(STORMPY_USE_CLN 1) |
|||
else() |
|||
set(STORMPY_USE_CLN 0) |
|||
endif() |
|||
|
|||
# Set configuration file |
|||
get_directory_property(STORMPY_INCLUDE_DIRS_PROP INCLUDE_DIRECTORIES) |
|||
foreach(arg ${STORMPY_INCLUDE_DIRS_PROP}) |
|||
set(STORMPY_INCLUDE_DIRS "${STORMPY_INCLUDE_DIRS}${sep}${arg}") |
|||
set(sep ":") |
|||
endforeach() |
|||
set(STORMPY_COMPILE_ARGS ${CMAKE_CXX_FLAGS}) |
|||
set(STORMPY_LIBRARY_DIRS "${PROJECT_BINARY_DIR}/src") |
|||
set(STORMPY_RPATH "${PROJECT_BINARY_DIR}/src") |
|||
configure_file ( |
|||
"${PROJECT_SOURCE_DIR}/stormpy/setup.cfg.in" |
|||
"${PROJECT_SOURCE_DIR}/stormpy/setup.cfg" |
|||
) |
|||
|
|||
add_custom_target(stormpy DEPENDS |
|||
stormpy_files |
|||
stormpy_core |
|||
stormpy_info |
|||
stormpy_expressions |
|||
stormpy_storage |
|||
stormpy_logic |
|||
# Add targets |
|||
add_custom_target(PythonBindingsBuild |
|||
COMMAND ${PYTHON_EXECUTABLE} setup.py build |
|||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
|||
DEPENDS storm |
|||
) |
|||
add_custom_target(PythonBindingsDevelop |
|||
COMMAND ${PYTHON_EXECUTABLE} setup.py develop |
|||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
|||
DEPENDS storm |
|||
) |
|||
add_custom_target(PythonBindingsInstall |
|||
COMMAND ${PYTHON_EXECUTABLE} setup.py install --user |
|||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
|||
DEPENDS storm |
|||
) |
@ -1,4 +1,5 @@ |
|||
[build_ext] |
|||
compile_flags=@STORMPY_COMPILE_ARGS@ |
|||
use-cln=@STORMPY_USE_CLN@ |
|||
include_dirs=@STORMPY_INCLUDE_DIRS@ |
|||
library_dirs=@STORMPY_LIBRARY_DIRS@ |
|||
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue