blob: 96390882fe5d667b4ad2c180e62c24cbc8983b5c (
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
set(mylist alpha bravo charlie delta)
list(TRANSFORM mylist APPEND "_A" OUTPUT_VARIABLE output)
if (NOT output STREQUAL "alpha_A;bravo_A;charlie_A;delta_A")
message (FATAL_ERROR "TRANSFORM(APPEND) is \"${output}\", expected is \"alpha_A;bravo_A;charlie_A;delta_A\"")
endif()
unset(output)
list(TRANSFORM mylist APPEND "_A" AT 1 3 OUTPUT_VARIABLE output)
if (NOT output STREQUAL "alpha;bravo_A;charlie;delta_A")
message (FATAL_ERROR "TRANSFORM(APPEND) is \"${output}\", expected is \"alpha;bravo_A;charlie;delta_A\"")
endif()
unset(output)
list(TRANSFORM mylist APPEND "_A" AT 1 -2 OUTPUT_VARIABLE output)
if (NOT output STREQUAL "alpha;bravo_A;charlie_A;delta")
message (FATAL_ERROR "TRANSFORM(APPEND) is \"${output}\", expected is \"alpha;bravo_A;charlie_A;delta\"")
endif()
unset(output)
list(TRANSFORM mylist APPEND "_A" FOR 1 2 OUTPUT_VARIABLE output)
if (NOT output STREQUAL "alpha;bravo_A;charlie_A;delta")
message (FATAL_ERROR "TRANSFORM(APPEND) is \"${output}\", expected is \"alpha;bravo_A;charlie_A;delta\"")
endif()
unset(output)
list(TRANSFORM mylist APPEND "_A" FOR 1 -1 OUTPUT_VARIABLE output)
if (NOT output STREQUAL "alpha;bravo_A;charlie_A;delta_A")
message (FATAL_ERROR "TRANSFORM(APPEND) is \"${output}\", expected is \"alpha;bravo_A;charlie_A;delta_A\"")
endif()
unset(output)
list(TRANSFORM mylist APPEND "_A" FOR 0 -1 2 OUTPUT_VARIABLE output)
if (NOT output STREQUAL "alpha_A;bravo;charlie_A;delta")
message (FATAL_ERROR "TRANSFORM(APPEND) is \"${output}\", expected is \"alpha_A;bravo;charlie_A;delta\"")
endif()
unset(output)
list(TRANSFORM mylist APPEND "_A" REGEX "(r|t)a" OUTPUT_VARIABLE output)
if (NOT output STREQUAL "alpha;bravo_A;charlie;delta_A")
message (FATAL_ERROR "TRANSFORM(APPEND) is \"${output}\", expected is \"alpha;bravo_A;charlie;delta_A\"")
endif()
unset(output)
list(TRANSFORM mylist APPEND "_A" REGEX "(r|t)a")
if (NOT mylist STREQUAL "alpha;bravo_A;charlie;delta_A")
message (FATAL_ERROR "TRANSFORM(APPEND) is \"${mylist}\", expected is \"alpha;bravo_A;charlie;delta_A\"")
endif()
|