Skip to content

Commit

Permalink
[CMake] Added option OGS_BUILD_PROCESSES.
Browse files Browse the repository at this point in the history
;-separated list of processes to build, e.g.:

cmake . -DOGS_BUILD_PROCESSES="HT;LIE"
  • Loading branch information
bilke committed Oct 4, 2018
1 parent 04631b2 commit 893f8d5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
16 changes: 15 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#####################

# Specify minimum CMake version
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.3)

# Set CMake policies
cmake_policy(SET CMP0011 NEW)
Expand Down Expand Up @@ -110,6 +110,20 @@ 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_PROCESSES}" STREQUAL "")
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)
option(OGS_BUILD_SWMM "Should the SWMM interface be built?" OFF)
endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ CMake switches to enable / disable parts of OGS.
- `OGS_BUILD_TESTS` - Builds the test executables. *Defaults* to *ON*.
- `OGS_BUILD_UTILS` - Builds several utilities.
- `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.
- `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

Expand Down

0 comments on commit 893f8d5

Please sign in to comment.