Files
source/cmake/ValidateOptions.cmake
majcostaandGitHub e4295acfec simplify the language/executable validation function (#79)
* 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
2023-01-17 23:32:38 -08:00

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()