diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ae82d642f6b29cef155f878b6f84d66ff0489c2..f8eb16e551f0e40f2c4e220f9b541533d92a83fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,6 +66,7 @@ option(OGS_USE_CVODE "Use the Sundials CVODE module?" OFF) # ---- CMake includes ---- include(PreFind) include(SubmoduleSetup) +include(ProcessesSetup) add_subdirectory(ThirdParty) include(Versions) include(CheckTypeSizes) @@ -104,67 +105,6 @@ if(OGS_BUILD_UTILS AND OGS_USE_MPI) set(OGS_BUILD_UTILS OFF CACHE BOOL "" FORCE) endif() -# A list of processes to be build. Also used in the ProcessLib to select -# processes to be build. -set(ProcessesList - ComponentTransport - GroundwaterFlow - HT - HeatConduction - HeatTransportBHE - HydroMechanics - LiquidFlow - LIE - PhaseField - RichardsComponentTransport - RichardsFlow - RichardsMechanics - SmallDeformation - SmallDeformationNonlocal - TES - ThermalTwoPhaseFlowWithPP - ThermoHydroMechanics - ThermoMechanicalPhaseField - ThermoMechanics - TwoPhaseFlowWithPP - TwoPhaseFlowWithPrho) - -# Add a cmake option for each process. -foreach(process ${ProcessesList}) - option(OGS_BUILD_PROCESS_${process} "Build the ${process} process." ON) -endforeach() - -set(OGS_BUILD_PROCESSES - "" - CACHE STRING "Semicolon-separated list of processes to build") -if(NOT OGS_BUILD_CLI) - set(OGS_BUILD_PROCESSES OFF "" CACHE INTERNAL "") -endif() -if(NOT "${OGS_BUILD_PROCESSES}" STREQUAL "") - if(${OGS_BUILD_PROCESSES}) - foreach(process ${OGS_BUILD_PROCESSES}) - if(NOT "${process}" IN_LIST ProcessesList) - message( - FATAL_ERROR - "${process} given in OGS_BUILD_PROCESSES is " - "not a valid process name! Valid names are ${ProcessesList}" - ) - endif() - endforeach() - message(STATUS "Enabled processes:") - else() - message(STATUS "All processes disabled.") - endif() - foreach(process ${ProcessesList}) - if("${process}" IN_LIST OGS_BUILD_PROCESSES) - set(OGS_BUILD_PROCESS_${process} ON CACHE BOOL "" FORCE) - message(STATUS " ${process}") - else() - set(OGS_BUILD_PROCESS_${process} OFF CACHE BOOL "" FORCE) - endif() - endforeach() -endif() - if(WIN32) option(OGS_BUILD_SWMM "Should the SWMM interface be built?" OFF) endif() diff --git a/scripts/cmake/ProcessesSetup.cmake b/scripts/cmake/ProcessesSetup.cmake new file mode 100644 index 0000000000000000000000000000000000000000..2127ec5705fbb7722889fb03f1ef515cf50a87a1 --- /dev/null +++ b/scripts/cmake/ProcessesSetup.cmake @@ -0,0 +1,60 @@ +# A list of processes to be build. Also used in the ProcessLib to select +# processes to be build. +set(ProcessesList + ComponentTransport + GroundwaterFlow + HT + HeatConduction + HeatTransportBHE + HydroMechanics + LiquidFlow + LIE + PhaseField + RichardsComponentTransport + RichardsFlow + RichardsMechanics + SmallDeformation + SmallDeformationNonlocal + TES + ThermalTwoPhaseFlowWithPP + ThermoHydroMechanics + ThermoMechanicalPhaseField + ThermoMechanics + TwoPhaseFlowWithPP + TwoPhaseFlowWithPrho) + +# Add a cmake option for each process. +foreach(process ${ProcessesList}) + option(OGS_BUILD_PROCESS_${process} "Build the ${process} process." ON) +endforeach() + +set(OGS_BUILD_PROCESSES + "" + CACHE STRING "Semicolon-separated list of processes to build") +if(NOT OGS_BUILD_CLI) + set(OGS_BUILD_PROCESSES OFF "" CACHE INTERNAL "") +endif() +if(NOT "${OGS_BUILD_PROCESSES}" STREQUAL "") + if(${OGS_BUILD_PROCESSES}) + foreach(process ${OGS_BUILD_PROCESSES}) + if(NOT "${process}" IN_LIST ProcessesList) + message( + FATAL_ERROR + "${process} given in OGS_BUILD_PROCESSES is " + "not a valid process name! Valid names are ${ProcessesList}" + ) + endif() + endforeach() + message(STATUS "Enabled processes:") + else() + message(STATUS "All processes disabled.") + endif() + foreach(process ${ProcessesList}) + if("${process}" IN_LIST OGS_BUILD_PROCESSES) + set(OGS_BUILD_PROCESS_${process} ON CACHE BOOL "" FORCE) + message(STATUS " ${process}") + else() + set(OGS_BUILD_PROCESS_${process} OFF CACHE BOOL "" FORCE) + endif() + endforeach() +endif() \ No newline at end of file