summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/GenEx-LIST/PREPEND.cmake.in
blob: 49b8f98239fc96830e4bd4ca3de2210d27f79444 (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
33
34

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

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

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

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

unset(listvar)
list(PREPEND listvar e f)
set (output "$<LIST:PREPEND,,e,f>")
if (NOT output STREQUAL listvar)
  list (PREPEND errors "returns bad value: ${output}")
endif()


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