blob: 5b1fcb66e433db3b087d28199d3ac21ae8a5f932 (
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 TOUPPER OUTPUT_VARIABLE output)
if (NOT output STREQUAL "ALPHA;BRAVO;CHARLIE;DELTA")
message (FATAL_ERROR "TRANSFORM(TOUPPER) is \"${output}\", expected is \"ALPHA;BRAVO;CHARLIE;DELTA\"")
endif()
unset(output)
list(TRANSFORM mylist TOUPPER AT 1 3 OUTPUT_VARIABLE output)
if (NOT output STREQUAL "alpha;BRAVO;charlie;DELTA")
message (FATAL_ERROR "TRANSFORM(TOUPPER) is \"${output}\", expected is \"alpha;BRAVO;charlie;DELTA\"")
endif()
unset(output)
list(TRANSFORM mylist TOUPPER AT 1 -2 OUTPUT_VARIABLE output)
if (NOT output STREQUAL "alpha;BRAVO;CHARLIE;delta")
message (FATAL_ERROR "TRANSFORM(TOUPPER) is \"${output}\", expected is \"alpha;BRAVO;CHARLIE;delta\"")
endif()
unset(output)
list(TRANSFORM mylist TOUPPER FOR 1 2 OUTPUT_VARIABLE output)
if (NOT output STREQUAL "alpha;BRAVO;CHARLIE;delta")
message (FATAL_ERROR "TRANSFORM(TOUPPER) is \"${output}\", expected is \"alpha;BRAVO;CHARLIE;delta\"")
endif()
unset(output)
list(TRANSFORM mylist TOUPPER FOR 1 -1 OUTPUT_VARIABLE output)
if (NOT output STREQUAL "alpha;BRAVO;CHARLIE;DELTA")
message (FATAL_ERROR "TRANSFORM(TOUPPER) is \"${output}\", expected is \"alpha;BRAVO;CHARLIE;DELTA\"")
endif()
unset(output)
list(TRANSFORM mylist TOUPPER FOR 0 -1 2 OUTPUT_VARIABLE output)
if (NOT output STREQUAL "ALPHA;bravo;CHARLIE;delta")
message (FATAL_ERROR "TRANSFORM(TOUPPER) is \"${output}\", expected is \"ALPHA;bravo;CHARLIE;delta\"")
endif()
unset(output)
list(TRANSFORM mylist TOUPPER REGEX "(r|t)a" OUTPUT_VARIABLE output)
if (NOT output STREQUAL "alpha;BRAVO;charlie;DELTA")
message (FATAL_ERROR "TRANSFORM(TOUPPER) is \"${output}\", expected is \"alpha;BRAVO;charlie;DELTA\"")
endif()
unset(output)
list(TRANSFORM mylist TOUPPER REGEX "(r|t)a")
if (NOT mylist STREQUAL "alpha;BRAVO;charlie;DELTA")
message (FATAL_ERROR "TRANSFORM(TOUPPER) is \"${mylist}\", expected is \"alpha;BRAVO;charlie;DELTA\"")
endif()
|