list interprets as empty if last element is not defined
cmake versions: 2.23, 2.25
example:
project(test)
set(data A)
list(APPEND data 1)
list(APPEND data 2)
list(APPEND data 3)
list(APPEND data non_existing-NOTFOUND)
if (data)
message (STATUS "list not empty")
else ()
message (FATAL_ERROR "list is empty")
endif ()
It is very confusing behavior. Documentation says, that if(var) false if value ends with "-NOTFOUND". But we have a list of many elements. It looks very strange that if last element has "-NOTFOUND" suffix, it means all list is interprets as FALSE.