Skip to content
Snippets Groups Projects
Unverified Commit 9be2fe43 authored by Lars Bilke's avatar Lars Bilke
Browse files

[cmake] Simplified ProcessLib setup.

parent 085587e9
No related branches found
No related tags found
No related merge requests found
...@@ -2,27 +2,17 @@ ...@@ -2,27 +2,17 @@
add_library(Processes INTERFACE) add_library(Processes INTERFACE)
# Check whether LIE processes are enabled # Check whether LIE processes are enabled
function(check_enabled_processes_for_LIE contains_LIE) foreach(process ${_enabled_processes})
set(${contains_hm_process} FALSE PARENT_SCOPE) if(process STREQUAL "LIE_M" OR process STREQUAL "LIE_HM")
foreach(process ${_enabled_processes}) add_subdirectory(LIE/Common)
if(process STREQUAL "LIE_M" break()
OR process STREQUAL "LIE_HM" endif()
) endforeach()
set(${contains_LIE} TRUE PARENT_SCOPE)
return()
endif()
endforeach()
endfunction()
check_enabled_processes_for_LIE(contains_LIE)
if (contains_LIE)
add_subdirectory(LIE/Common)
endif()
foreach(process ${_enabled_processes}) foreach(process ${_enabled_processes})
if (process STREQUAL "LIE_HM") if(process STREQUAL "LIE_HM")
add_subdirectory(LIE/HydroMechanics) add_subdirectory(LIE/HydroMechanics)
elseif (process STREQUAL "LIE_M") elseif(process STREQUAL "LIE_M")
add_subdirectory(LIE/SmallDeformation) add_subdirectory(LIE/SmallDeformation)
else() else()
add_subdirectory(${process}) add_subdirectory(${process})
...@@ -43,27 +33,18 @@ append_source_files(SOURCES Utils) ...@@ -43,27 +33,18 @@ append_source_files(SOURCES Utils)
append_source_files(SOURCES Reflection) append_source_files(SOURCES Reflection)
append_source_files(SOURCES Graph) append_source_files(SOURCES Graph)
# For processes that contains both hydraulical process and mechanical process # For processes that contains both hydraulical process and mechanical process
# Define a function to check if enabled_processes contains LIE, HydroMechanics, foreach(process ${_enabled_processes})
# ThermoHydroMechanics, RichardsMechanics, or ThermoRichardsMechanics if(process STREQUAL "LIE_HM"
function(check_enabled_processes contains_hm_process) OR process STREQUAL "HydroMechanics"
set(${contains_hm_process} FALSE PARENT_SCOPE) OR process STREQUAL "ThermoHydroMechanics"
foreach(process ${_enabled_processes}) OR process STREQUAL "RichardsMechanics"
if(process STREQUAL "LIE_HM" OR process STREQUAL "TH2M"
OR process STREQUAL "HydroMechanics" OR process STREQUAL "ThermoRichardsMechanics"
OR process STREQUAL "ThermoHydroMechanics" )
OR process STREQUAL "RichardsMechanics" append_source_files(SOURCES Common/HydroMechanics)
OR process STREQUAL "TH2M" break()
OR process STREQUAL "ThermoRichardsMechanics" endif()
) endforeach()
set(${contains_hm_process} TRUE PARENT_SCOPE)
return()
endif()
endforeach()
endfunction()
check_enabled_processes(contains_hm_process)
if(contains_hm_process)
append_source_files(SOURCES Common/HydroMechanics)
endif()
ogs_add_library(ProcessLib GENERATE_EXPORT_HEADER ${SOURCES}) ogs_add_library(ProcessLib GENERATE_EXPORT_HEADER ${SOURCES})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment