Skip to content
Snippets Groups Projects
Unverified Commit 4c3902ff authored by Lars Bilke's avatar Lars Bilke Committed by GitHub
Browse files

Merge pull request #2233 from bilke/cmake-single-process

[CMake] Added option OGS_BUILD_PROCESSES.
parents 2727104f 1c2031ed
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
##################### #####################
# Specify minimum CMake version # Specify minimum CMake version
cmake_minimum_required(VERSION 3.2) cmake_minimum_required(VERSION 3.3)
# Set CMake policies # Set CMake policies
cmake_policy(SET CMP0011 NEW) cmake_policy(SET CMP0011 NEW)
...@@ -110,6 +110,26 @@ foreach(process ${ProcessesList}) ...@@ -110,6 +110,26 @@ foreach(process ${ProcessesList})
option(OGS_BUILD_PROCESS_${process} "Build the ${process} process." ON) option(OGS_BUILD_PROCESS_${process} "Build the ${process} process." ON)
endforeach() endforeach()
set(OGS_BUILD_PROCESSES "" CACHE STRING "Semicolon-separated list of processes to build")
if(NOT "${OGS_BUILD_PROCESSES}" STREQUAL "")
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:")
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) if(WIN32)
option(OGS_BUILD_SWMM "Should the SWMM interface be built?" OFF) option(OGS_BUILD_SWMM "Should the SWMM interface be built?" OFF)
endif() endif()
......
...@@ -22,8 +22,9 @@ CMake switches to enable / disable parts of OGS. ...@@ -22,8 +22,9 @@ CMake switches to enable / disable parts of OGS.
- `OGS_BUILD_TESTS` - Builds the test executables. *Defaults* to *ON*. - `OGS_BUILD_TESTS` - Builds the test executables. *Defaults* to *ON*.
- `OGS_BUILD_UTILS` - Builds several utilities. - `OGS_BUILD_UTILS` - Builds several utilities.
- `OGS_NO_EXTERNAL_LIBS` - Disables all external optional dependencies. - `OGS_NO_EXTERNAL_LIBS` - Disables all external optional dependencies.
- `OGS_BUILD_PROCESS_X=OFF` - For disabling compilation of process `X`. - `OGS_BUILD_PROCESS_X` - For enabling/disabling compilation of process `X`.
Run the CMake-Gui to see a list of processes. Run the CMake-Gui to see a list of processes.
- `OGS_BUILD_PROCESSES` - A `;`-separated list specifying processes to build. *Defaults* to an *empty string*. This will alter the `OGS_BUILD_PROCESS_X`-options. For e.g. building just the two processes `HT` and `LIE`: `-DOGS_BUILD_PROCESSES="HT;LIE"`. Setting this variable back to an empty string **does not reset** the `OGS_BUILD_PROCESS_X`-options.
#### Debugging #### Debugging
......
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