Cmake IN_LIST for variable
list(APPEND test_list A B C)
function(test value)
message("Value name: ${value}, payload: ${${value}}")
if(NOT ${value} IN_LIST test_list)
message(FATAL_ERROR "WHY?")
endif()
endfunction()
test(A)
test(A)
set(A 1)
test(A)
Output:
Value name: A, payload:
Value name: A, payload:
Value name: A, payload: 1
CMake Error at some.cmake:9 (message):
WHY?
Is it correct behaviour? How can i check that the variable name is in the list?