before this, dune modules that are not using the OPM build system needed to treat opm-parser as an external library. With this patch, opm-parser can be build as part of duncontrol build chains, i.e., other modules just need to specify a depencency on opm-parser in their dune.module file and opm-parser's libraries and headers get picked up just fine. Things like generating opm-parser-config.cmake should quite likely be done in a better way, but I'm not really a cmake expert and the solution proposed in this patch seems to get things done regardless of whether opm-parser is system-installed or not. Comprehensive solutions are highly appreciated.
19 lines
843 B
CMake
19 lines
843 B
CMake
if(NOT opm-parser_FOUND)
|
|
#import the target
|
|
get_filename_component(_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
|
include("${_dir}/opm-parser-targets.cmake")
|
|
|
|
#report other information
|
|
set(opm-parser_INSTALLED "@OPM_PARSER_INSTALLED@")
|
|
set(opm-parser_PREFIX "@OPM_PARSER_PREFIX@")
|
|
set(opm-parser_INCLUDE_DIRS "@OPM_PARSER_INCLUDEDIRS@")
|
|
set(opm-parser_LIBRARY_DIRS "@OPM_PARSER_LIBDIRS@")
|
|
set(opm-parser_CXX_FLAGS "@CMAKE_CXX_FLAGS@")
|
|
set(opm-parser_CXX_FLAGS_DEBUG "@CMAKE_CXX_FLAGS_DEBUG@")
|
|
set(opm-parser_CXX_FLAGS_MINSIZEREL "@CMAKE_CXX_FLAGS_MINSIZEREL@")
|
|
set(opm-parser_CXX_FLAGS_RELEASE "@CMAKE_CXX_FLAGS_RELEASE@")
|
|
set(opm-parser_CXX_FLAGS_RELWITHDEBINFO "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@")
|
|
set(opm-parser_LIBRARIES "opmparser")
|
|
set(opm-parser_MODULE_PATH "@OPM_PARSER_MODULE_PATH@")
|
|
endif(NOT opm-parser_FOUND)
|