From 5583ab1a3ba8cead349e26b6675f9532e1d0b547 Mon Sep 17 00:00:00 2001 From: sjunges Date: Fri, 2 Dec 2016 09:46:44 +0100 Subject: [PATCH] wip: new cmake for stormpy --- stormpy/CMakeLists.txt | 92 ++++++++++++++++++++++++------------------ 1 file changed, 53 insertions(+), 39 deletions(-) diff --git a/stormpy/CMakeLists.txt b/stormpy/CMakeLists.txt index afd91d57e..38d2f2efa 100644 --- a/stormpy/CMakeLists.txt +++ b/stormpy/CMakeLists.txt @@ -1,39 +1,53 @@ -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/storm") -set(STORMPY_RPATH "${PROJECT_BINARY_DIR}/src/storm") -configure_file ( - "${PROJECT_SOURCE_DIR}/stormpy/setup.cfg.in" - "${PROJECT_SOURCE_DIR}/stormpy/setup.cfg" -) - -# 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 -) +cmake_minimum_required(VERSION 3.0.0) +project(pystorm) + + +find_package(storm REQUIRED) +add_subdirectory(resources/pybind11) + + +file(GLOB_RECURSE PYCARL_CORE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/core/*.cpp) + +pybind11_add_module(pycarl.core ${CMAKE_CURRENT_SOURCE_DIR}/src/mod_core.cpp ${PYCARL_CORE_SOURCES}) +target_include_directories(pycarl.core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(pycarl.core PRIVATE lib_carl) + + +file(GLOB_RECURSE PYCARL_CORE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/formula/*.cpp) + +pybind11_add_module(pycarl.formula ${CMAKE_CURRENT_SOURCE_DIR}/src/mod_formula.cpp ${PYCARL_FORMULA_SOURCES}) +target_include_directories(pycarl.formula PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(pycarl.formula PRIVATE lib_carl) + + +file(GLOB_RECURSE PYCARL_CORE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/parse/*.cpp) + +pybind11_add_module(pycarl.parse ${CMAKE_CURRENT_SOURCE_DIR}/src/mod_parse.cpp ${PYCARL_PARSE_SOURCES}) +target_include_directories(pycarl.parse PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(pycarl.parse PRIVATE lib_carl) + + +#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/storm") +#set(STORMPY_RPATH "${PROJECT_BINARY_DIR}/src/storm") +#configure_file ( +# "${PROJECT_SOURCE_DIR}/stormpy/setup.cfg.in" +# "${PROJECT_SOURCE_DIR}/stormpy/setup.cfg" +#) +# +