Skip to content

Commit 1341b4b

Browse files
committed
cmake: Use if(... IN_LIST ...) command
Available in CMake 3.3+.
1 parent 2d368df commit 1341b4b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

cmake/CheckStringOptionValue.cmake

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
function(check_string_option_value option)
22
get_property(expected_values CACHE ${option} PROPERTY STRINGS)
33
if(expected_values)
4-
foreach(value IN LISTS expected_values)
5-
if(value STREQUAL "${${option}}")
6-
return()
7-
endif()
8-
endforeach()
4+
if(${option} IN_LIST expected_values)
5+
return()
6+
endif()
97
message(FATAL_ERROR "${option} value is \"${${option}}\", but must be one of ${expected_values}.")
108
endif()
119
message(AUTHOR_WARNING "The STRINGS property must be set before invoking `check_string_option_value' function.")

0 commit comments

Comments
 (0)