2
2
add_library (Processes INTERFACE )
3
3
4
4
# Check whether LIE processes are enabled
5
- function (check_enabled_processes_for_LIE contains_LIE )
6
- set (${contains_hm_process} FALSE PARENT_SCOPE )
7
- foreach (process ${_enabled_processes} )
8
- if (process STREQUAL "LIE_M"
9
- OR process STREQUAL "LIE_HM"
10
- )
11
- set (${contains_LIE} TRUE PARENT_SCOPE )
12
- return ()
13
- endif ()
14
- endforeach ()
15
- endfunction ()
16
- check_enabled_processes_for_LIE (contains_LIE )
17
-
18
- if (contains_LIE )
19
- add_subdirectory (LIE/Common )
20
- endif ()
5
+ foreach (process ${_enabled_processes} )
6
+ if (process STREQUAL "LIE_M" OR process STREQUAL "LIE_HM" )
7
+ add_subdirectory (LIE/Common )
8
+ break ()
9
+ endif ()
10
+ endforeach ()
21
11
22
12
foreach (process ${_enabled_processes} )
23
- if (process STREQUAL "LIE_HM" )
13
+ if (process STREQUAL "LIE_HM" )
24
14
add_subdirectory (LIE/HydroMechanics )
25
- elseif (process STREQUAL "LIE_M" )
15
+ elseif (process STREQUAL "LIE_M" )
26
16
add_subdirectory (LIE/SmallDeformation )
27
17
else ()
28
18
add_subdirectory (${process} )
@@ -43,27 +33,18 @@ append_source_files(SOURCES Utils)
43
33
append_source_files (SOURCES Reflection )
44
34
append_source_files (SOURCES Graph )
45
35
# For processes that contains both hydraulical process and mechanical process
46
- # Define a function to check if enabled_processes contains LIE, HydroMechanics,
47
- # ThermoHydroMechanics, RichardsMechanics, or ThermoRichardsMechanics
48
- function (check_enabled_processes contains_hm_process )
49
- set (${contains_hm_process} FALSE PARENT_SCOPE )
50
- foreach (process ${_enabled_processes} )
51
- if (process STREQUAL "LIE_HM"
52
- OR process STREQUAL "HydroMechanics"
53
- OR process STREQUAL "ThermoHydroMechanics"
54
- OR process STREQUAL "RichardsMechanics"
55
- OR process STREQUAL "TH2M"
56
- OR process STREQUAL "ThermoRichardsMechanics"
57
- )
58
- set (${contains_hm_process} TRUE PARENT_SCOPE )
59
- return ()
60
- endif ()
61
- endforeach ()
62
- endfunction ()
63
- check_enabled_processes (contains_hm_process )
64
- if (contains_hm_process )
65
- append_source_files (SOURCES Common/HydroMechanics )
66
- endif ()
36
+ foreach (process ${_enabled_processes} )
37
+ if (process STREQUAL "LIE_HM"
38
+ OR process STREQUAL "HydroMechanics"
39
+ OR process STREQUAL "ThermoHydroMechanics"
40
+ OR process STREQUAL "RichardsMechanics"
41
+ OR process STREQUAL "TH2M"
42
+ OR process STREQUAL "ThermoRichardsMechanics"
43
+ )
44
+ append_source_files (SOURCES Common/HydroMechanics )
45
+ break ()
46
+ endif ()
47
+ endforeach ()
67
48
68
49
ogs_add_library (ProcessLib GENERATE_EXPORT_HEADER ${SOURCES} )
69
50
0 commit comments