There is a lot of code in TriBITS that passed strings as enums like:
if (<varName> STREQUAL "<valueA>")
...
elseif (<varName> STREQUAL "<valueB>")
...
elseif (<varName> STREQUAL "<valueC>")
...
else()
message(FATAL_ERROR "Error, the value of <varName>='${<varName>}' is not in the allowed list ...")
endif()
Description
There is a lot of code in TriBITS that passed strings as enums like:
It may help to replace this with a function like:
where the list of valid values var name
<listOfValidValues>
could be empty.NOTE: Something like this was suggested by @KyleFromKitware in https://github.com/TriBITSPub/TriBITS/pull/560#pullrequestreview-1312218533.