disable flow_alugrid in buildsystem if dune-alugrid was not found

This commit is contained in:
Arne Morten Kvarving
2022-11-15 13:52:02 +01:00
parent d15c2607f5
commit d7c468575b
2 changed files with 18 additions and 27 deletions
+3 -1
View File
@@ -499,13 +499,14 @@ opm_add_test(flow_distribute_z
${FLOW_TGTS} ${FLOW_TGTS}
$<TARGET_OBJECTS:moduleVersion> $<TARGET_OBJECTS:moduleVersion>
) )
if(dune-alugrid_FOUND)
if (NOT BUILD_FLOW_ALU_GRID) if (NOT BUILD_FLOW_ALU_GRID)
set(FLOW_ALUGRID_ONLY_DEFAULT_ENABLE_IF "FALSE") set(FLOW_ALUGRID_ONLY_DEFAULT_ENABLE_IF "FALSE")
else() else()
set(FLOW_ALUGRID_ONLY_DEFAULT_ENABLE_IF "TRUE") set(FLOW_ALUGRID_ONLY_DEFAULT_ENABLE_IF "TRUE")
endif() endif()
# the production oriented general-purpose ECL simulator
opm_add_test(flow_alugrid opm_add_test(flow_alugrid
ONLY_COMPILE ONLY_COMPILE
ALWAYS_ENABLE ALWAYS_ENABLE
@@ -516,6 +517,7 @@ opm_add_test(flow_alugrid
flow/flow_blackoil_alugrid.cpp flow/flow_blackoil_alugrid.cpp
$<TARGET_OBJECTS:moduleVersion>) $<TARGET_OBJECTS:moduleVersion>)
target_compile_definitions(flow_alugrid PRIVATE USE_ALUGRID) target_compile_definitions(flow_alugrid PRIVATE USE_ALUGRID)
endif()
if (BUILD_FLOW) if (BUILD_FLOW)
install(TARGETS flow DESTINATION bin) install(TARGETS flow DESTINATION bin)
-11
View File
@@ -30,17 +30,6 @@
#if USE_ALUGRID #if USE_ALUGRID
#define DISABLE_ALUGRID_SFC_ORDERING 1 #define DISABLE_ALUGRID_SFC_ORDERING 1
#if !HAVE_DUNE_ALUGRID
#warning "ALUGrid was indicated to be used for the ECL black oil simulator, but this "
#warning "requires the presence of dune-alugrid >= 2.4. Falling back to Dune::CpGrid"
#undef USE_ALUGRID
#define USE_ALUGRID 0
#endif
#else
#define USE_ALUGRID 0
#endif
#if USE_ALUGRID
#include "eclalugridvanguard.hh" #include "eclalugridvanguard.hh"
#elif USE_POLYHEDRALGRID #elif USE_POLYHEDRALGRID
#include "eclpolyhedralgridvanguard.hh" #include "eclpolyhedralgridvanguard.hh"