summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/GenEx-LIST/REMOVE_ITEM.cmake.in
blob: 5434a5d51d0ea246c4d5c5b22b435814e7a05458 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

include ("${RunCMake_SOURCE_DIR}/check_errors.cmake")
unset (errors)

set(listvar a b c d)
list(REMOVE_ITEM listvar b d)
set (output "$<LIST:REMOVE_ITEM,a;b;c;d,b,d>")
if (NOT output STREQUAL listvar)
  list (APPEND errors "returns bad value: ${output}")
endif()

set(listvar a b c d)
list(REMOVE_ITEM listvar b e)
set (output "$<LIST:REMOVE_ITEM,a;b;c;d,b,e>")
if (NOT output STREQUAL listvar)
  list (APPEND errors "returns bad value: ${output}")
endif()

set(listvar a b c d)
list(REMOVE_ITEM listvar b a d c)
set (output "$<LIST:REMOVE_ITEM,a;b;c;d,b;a;d;c>")
if (NOT output STREQUAL listvar)
  list (APPEND errors "returns bad value: ${output}")
endif()

set (output "$<LIST:REMOVE_ITEM,,b;a;d;c>")
if (NOT output STREQUAL "")
  list (APPEND errors "returns bad value: ${output}")
endif()


check_errors("LIST:REMOVE_ITEM..." ${errors})