2019-05-08 07:20:29 +02:00
|
|
|
pybind11_add_module(libsunbeam sunbeam.cpp
|
|
|
|
|
eclipse_state.cpp
|
|
|
|
|
deck_keyword.cpp
|
|
|
|
|
deck.cpp
|
|
|
|
|
well.cpp
|
|
|
|
|
sunbeam_state.cpp
|
|
|
|
|
schedule.cpp
|
|
|
|
|
connection.cpp
|
|
|
|
|
eclipse_config.cpp
|
|
|
|
|
table_manager.cpp
|
|
|
|
|
eclipse_grid.cpp
|
|
|
|
|
group.cpp
|
|
|
|
|
group_tree.cpp
|
|
|
|
|
eclipse_3d_properties.cpp
|
|
|
|
|
parser.cpp)
|
2016-11-25 14:45:52 +01:00
|
|
|
|
2019-05-08 07:20:29 +02:00
|
|
|
set_target_properties( libsunbeam PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/python/sunbeam )
|
2018-02-23 13:50:02 +01:00
|
|
|
|
2019-05-08 07:20:29 +02:00
|
|
|
# The cmake config files generated by opm-common are generated in a non standard
|
|
|
|
|
# way and they are not fully relocatable. This creates problems when we are
|
|
|
|
|
# building sunbeam towards a opm-common distribution which has been installed
|
|
|
|
|
# using the DESTDIR option in make install.
|
|
|
|
|
#
|
|
|
|
|
# If we subsequently configure sunbeam as:
|
|
|
|
|
#
|
|
|
|
|
# bash% cmake .. -DDEST_PREFIX=/path/to/DESTDIR
|
|
|
|
|
#
|
|
|
|
|
# There is an extreme scotch-tape-and-chewing-gum solution which just barely
|
|
|
|
|
# works:
|
|
|
|
|
#
|
|
|
|
|
# 1. When evaluating opm-common-config.cmake the DEST_PREFIX variable is
|
|
|
|
|
# detected and the paths are manually prefixed with DEST_PREFIX.
|
|
|
|
|
#
|
|
|
|
|
# 2. Here we link explicitly to the dependenencies of opm-common; i.e. ecl and
|
|
|
|
|
# three boost libraries insteady linking transitively through the
|
|
|
|
|
# ${opm-common_LIBRARIES} variable.
|
|
|
|
|
#
|
|
|
|
|
# See also the file cmake/Templates/opm-project-config.cmake.in in the
|
|
|
|
|
# opm-common distribution which this hack depends on.
|
|
|
|
|
|
|
|
|
|
if (DEST_PREFIX)
|
|
|
|
|
find_package(ecl)
|
|
|
|
|
find_package(Boost REQUIRED COMPONENTS filesystem regex)
|
|
|
|
|
target_link_libraries(libsunbeam PRIVATE ecl)
|
|
|
|
|
target_link_libraries(libsunbeam PRIVATE ${Boost_LIBRARIES})
|
2019-06-20 10:05:53 +02:00
|
|
|
target_link_libraries(libsunbeam PRIVATE opmcommon)
|
2019-05-08 07:20:29 +02:00
|
|
|
else()
|
2019-06-20 10:05:53 +02:00
|
|
|
target_link_libraries( libsunbeam PRIVATE opmcommon )
|
2019-05-08 07:20:29 +02:00
|
|
|
endif()
|
|
|
|
|
install(TARGETS libsunbeam DESTINATION ${PYTHON_INSTALL_PREFIX}/sunbeam)
|