secp256k1-zkp/cmake/CheckStringOptionValue.cmake
Hennadii Stepanov 6a58b483ef
cmake: Use if(... IN_LIST ...) command
Available in CMake 3.3+.
2023-04-20 17:00:11 +01:00

11 lines
441 B
CMake

function(check_string_option_value option)
get_property(expected_values CACHE ${option} PROPERTY STRINGS)
if(expected_values)
if(${option} IN_LIST expected_values)
return()
endif()
message(FATAL_ERROR "${option} value is \"${${option}}\", but must be one of ${expected_values}.")
endif()
message(AUTHOR_WARNING "The STRINGS property must be set before invoking `check_string_option_value' function.")
endfunction()