mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
* simplify the language/executable validation function removing the 'ALL' corner-case so that the default behavior is to configure all valid languages and applications allows to simplify this function quite a bit * keep the CMakePreset.json options listed for ease of use
16 lines
473 B
CMake
16 lines
473 B
CMake
function(ValidateOptions ValidOptions ChoiceName Choice RetVal)
|
|
if(Choice)
|
|
foreach(x IN LISTS Choice)
|
|
if(NOT x IN_LIST ValidOptions)
|
|
message(FATAL_ERROR "${ChoiceName}=\"${x}\" is not supported. Valid options are: ${ValidOptions}.")
|
|
endif()
|
|
endforeach()
|
|
else()
|
|
set(isDefault "by default.")
|
|
set(Choice ${ValidOptions})
|
|
endif()
|
|
message(STATUS "Configuring ${ChoiceName}=\"${Choice}\" ${isDefault}")
|
|
|
|
set(${RetVal} ${Choice} PARENT_SCOPE)
|
|
endfunction()
|