blob: 366c63a83c2fb3de93dfe5c9d69716d19a1585fa (
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
49
|
set(mylist " alpha" "bravo " " charlie " delta)
list(TRANSFORM mylist STRIP OUTPUT_VARIABLE output)
if (NOT output STREQUAL "alpha;bravo;charlie;delta")
message (FATAL_ERROR "TRANSFORM(STRIP) is \"${output}\", expected is \"alpha;bravo;charlie;delta\"")
endif()
set(mylist " alpha" "bravo " " charlie " "delta ")
unset(output)
list(TRANSFORM mylist STRIP AT 1 3 OUTPUT_VARIABLE output)
if (NOT output STREQUAL " alpha;bravo; charlie ;delta")
message (FATAL_ERROR "TRANSFORM(STRIP) is \"${output}\", expected is \" alpha;bravo; charlie ;delta\"")
endif()
unset(output)
list(TRANSFORM mylist STRIP AT 1 -2 OUTPUT_VARIABLE output)
if (NOT output STREQUAL " alpha;bravo;charlie;delta ")
message (FATAL_ERROR "TRANSFORM(STRIP) is \"${output}\", expected is \" alpha;bravo;charlie;delta \"")
endif()
unset(output)
list(TRANSFORM mylist STRIP FOR 1 2 OUTPUT_VARIABLE output)
if (NOT output STREQUAL " alpha;bravo;charlie;delta ")
message (FATAL_ERROR "TRANSFORM(STRIP) is \"${output}\", expected is \" alpha;bravo;charlie;delta \"")
endif()
unset(output)
list(TRANSFORM mylist STRIP FOR 1 -1 OUTPUT_VARIABLE output)
if (NOT output STREQUAL " alpha;bravo;charlie;delta")
message (FATAL_ERROR "TRANSFORM(STRIP) is \"${output}\", expected is \" alpha;bravo;charlie;delta\"")
endif()
unset(output)
list(TRANSFORM mylist STRIP FOR 0 -1 2 OUTPUT_VARIABLE output)
if (NOT output STREQUAL "alpha;bravo ;charlie;delta ")
message (FATAL_ERROR "TRANSFORM(STRIP) is \"${output}\", expected is \"alpha;bravo ;charlie;delta \"")
endif()
unset(output)
list(TRANSFORM mylist STRIP REGEX "(r|t)a" OUTPUT_VARIABLE output)
if (NOT output STREQUAL " alpha;bravo; charlie ;delta")
message (FATAL_ERROR "TRANSFORM(STRIP) is \"${output}\", expected is \" alpha;bravo; charlie ;delta\"")
endif()
unset(output)
list(TRANSFORM mylist STRIP REGEX "(r|t)a")
if (NOT mylist STREQUAL " alpha;bravo; charlie ;delta")
message (FATAL_ERROR "TRANSFORM(STRIP) is \"${mylist}\", expected is \" alpha;bravo; charlie ;delta\"")
endif()
|