Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CMake] Added option OGS_BUILD_PROCESSES. #2233

Merged
merged 2 commits into from
Oct 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 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,26 @@ 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 "")
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)
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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe then it would have been better to not cache this setting at all but to only use it upon first initialization,
b/c probably changes to OGS_BUILD_PROCESS_X won't sync either.


#### Debugging

Expand Down