CMake/Tests/RunCMake/list/REMOVE_AT-EmptyList.cmake
Ben Boeckel 121a036f73 cmListCommand: handle empty lists for list(REMOVE_AT)
Treat an empty list as a list with no valid bounds and return an error
message indicating that any given indices are out-of-bounds.
2018-10-16 14:31:39 -04:00

7 lines
178 B
CMake

set(nosuchlist "")
list(REMOVE_AT nosuchlist 0)
if (NOT DEFINED nosuchlist OR NOT nosuchlist STREQUAL "")
message(FATAL_ERROR
"list(REMOVE_AT) modified our list")
endif ()