cmake/Tests/RunCMake/GenEx-LIST/REMOVE_DUPLICATES.cmake.in

21 lines
546 B
CMake
Raw Normal View History

2023-07-02 19:51:09 +02:00
include ("${RunCMake_SOURCE_DIR}/check_errors.cmake")
unset (errors)
set(listvar a b c d)
list(REMOVE_DUPLICATES listvar)
set (output "$<LIST:REMOVE_DUPLICATES,a;b;c;d>")
if (NOT output STREQUAL listvar)
list (APPEND errors "returns bad value: ${output}")
endif()
set(listvar "b;c;b;a;a;c;b;a;c;b")
list(REMOVE_DUPLICATES listvar)
set (output "$<LIST:REMOVE_DUPLICATES,b;c;b;a;a;c;b;a;c;b>")
if (NOT output STREQUAL listvar)
list (APPEND errors "returns bad value: ${output}")
endif()
check_errors("LIST:REMOVE_DUPLICATES..." ${errors})