Browse Source

Use given storm-dir for checking if dft is available

refactoring
Matthias Volk 8 years ago
parent
commit
3df8f71c0a
  1. 3
      CMakeLists.txt
  2. 7
      setup.py

3
CMakeLists.txt

@ -8,6 +8,7 @@ add_subdirectory(resources/pybind11)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/generated/config.h) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/generated/config.h)
message(STATUS "STORM-DIR: ${storm_DIR}")
set(STORMPY_LIB_DIR "${CMAKE_SOURCE_DIR}/lib/stormpy" CACHE STRING "Sets the storm library dir") set(STORMPY_LIB_DIR "${CMAKE_SOURCE_DIR}/lib/stormpy" CACHE STRING "Sets the storm library dir")
@ -24,7 +25,7 @@ function(stormpy_module NAME)
file(GLOB_RECURSE "STORM_${NAME}_SOURCES" "${CMAKE_CURRENT_SOURCE_DIR}/src/${NAME}/*.cpp") file(GLOB_RECURSE "STORM_${NAME}_SOURCES" "${CMAKE_CURRENT_SOURCE_DIR}/src/${NAME}/*.cpp")
pybind11_add_module(${NAME} "${CMAKE_CURRENT_SOURCE_DIR}/src/mod_${NAME}.cpp" ${STORM_${NAME}_SOURCES}) pybind11_add_module(${NAME} "${CMAKE_CURRENT_SOURCE_DIR}/src/mod_${NAME}.cpp" ${STORM_${NAME}_SOURCES})
if(ARGC GREATER 2) if(ARGC GREATER 2)
# Additional libraries # Additional libraries
target_include_directories(${NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${storm_INCLUDE_DIR} ${ARGV3} ${CMAKE_CURRENT_BINARY_DIR}/src/generated) target_include_directories(${NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${storm_INCLUDE_DIR} ${ARGV3} ${CMAKE_CURRENT_BINARY_DIR}/src/generated)

7
setup.py

@ -36,7 +36,10 @@ class CMakeBuild(build_ext):
os.makedirs(build_temp_version) os.makedirs(build_temp_version)
# Check cmake variable values # Check cmake variable values
output = subprocess.check_output(['cmake', os.path.abspath("cmake")], cwd=build_temp_version)
cmake_args = []
if self.storm_dir is not None:
cmake_args = ['-Dstorm_DIR=' + self.storm_dir]
output = subprocess.check_output(['cmake', os.path.abspath("cmake")] + cmake_args, cwd=build_temp_version)
output = output.decode('ascii') output = output.decode('ascii')
match = re.search(r"STORM-DIR: (.*)", output) match = re.search(r"STORM-DIR: (.*)", output)
assert(match) assert(match)
@ -69,7 +72,7 @@ class CMakeBuild(build_ext):
print(extdir) print(extdir)
cmake_args = ['-DSTORMPY_LIB_DIR=' + extdir, cmake_args = ['-DSTORMPY_LIB_DIR=' + extdir,
'-DPYTHON_EXECUTABLE=' + sys.executable] '-DPYTHON_EXECUTABLE=' + sys.executable]
cfg = 'Release' # if self.debug else 'Release' cfg = 'Release' # if self.debug else 'Release'
build_args = ['--config', cfg] build_args = ['--config', cfg]

Loading…
Cancel
Save