diff --git a/CMakeLists.txt b/CMakeLists.txt index 5cf87cd9dd..9de6eaed8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -638,6 +638,7 @@ macro(opm-simulators_targets_hook) add_library(moduleVersion OBJECT opm/simulators/utils/moduleVersion.cpp) opm_add_target_options(TARGET moduleVersion) + target_include_directories(moduleVersion BEFORE PRIVATE ${PROJECT_BINARY_DIR}) # Strictly we only depend on the update-version target, # but this is not exposed in a super-build. @@ -645,6 +646,7 @@ macro(opm-simulators_targets_hook) add_library(MainDispatchDynamic OBJECT opm/simulators/flow/MainDispatchDynamic.cpp) simulators_add_target_options(TARGET MainDispatchDynamic) + target_include_directories(MainDispatchDynamic BEFORE PRIVATE ${PROJECT_BINARY_DIR}) target_sources(test_outputdir PRIVATE $) target_sources(test_equil PRIVATE $) @@ -694,6 +696,7 @@ macro(opm-simulators_targets_hook) foreach(OBJ ${COMMON_MODELS} ${FLOW_MODELS} ${FLOW_VARIANT_MODELS}) add_library(flow_lib${OBJ} OBJECT flow/flow_${OBJ}.cpp) target_link_libraries(flow_lib${OBJ} PRIVATE opmcommon) + target_include_directories(flow_lib${OBJ} BEFORE PRIVATE ${PROJECT_BINARY_DIR}) simulators_add_target_options(TARGET flow_lib${OBJ}) list(APPEND FLOW_TGTS $) list(APPEND FLOWMODELS_PREFIXED flow_${OBJ})