summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/foreach/foreach-all-test.cmake
blob: 2e377c80286b4a6644ff6f4a3cc1fc861ae73b3a (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
message(STATUS "foreach(RANGE):")
list(APPEND CMAKE_MESSAGE_INDENT "  ")

message(STATUS "[0..1]/1")
list(APPEND CMAKE_MESSAGE_INDENT "  < ")
foreach(i RANGE 1)
    message(STATUS ${i})
endforeach()
list(POP_BACK CMAKE_MESSAGE_INDENT)

message(STATUS "[1..1]/1")
list(APPEND CMAKE_MESSAGE_INDENT "  < ")
foreach(i RANGE 1 1)
    message(STATUS ${i})
endforeach()
list(POP_BACK CMAKE_MESSAGE_INDENT)

message(STATUS "[0..10]/2")
list(APPEND CMAKE_MESSAGE_INDENT "  < ")
foreach(i RANGE 0 10 2)
    message(STATUS ${i})
endforeach()
list(POP_BACK CMAKE_MESSAGE_INDENT)

message(STATUS "[-10..0]/3")
list(APPEND CMAKE_MESSAGE_INDENT "  < ")
foreach(i RANGE -10 0 3)
    message(STATUS ${i})
endforeach()
list(POP_BACK CMAKE_MESSAGE_INDENT)

message(STATUS "[0..-10]/-5")
list(APPEND CMAKE_MESSAGE_INDENT "  < ")
foreach(i RANGE 0 -10 -5)
    message(STATUS ${i})
endforeach()
list(POP_BACK CMAKE_MESSAGE_INDENT)
list(POP_BACK CMAKE_MESSAGE_INDENT)

message(STATUS "foreach(IN ITEMS):")
list(APPEND CMAKE_MESSAGE_INDENT "  < ")
foreach(i IN ITEMS one two three)
    message(STATUS ${i})
endforeach()
list(POP_BACK CMAKE_MESSAGE_INDENT)

message(STATUS "foreach(IN LISTS):")
list(APPEND CMAKE_MESSAGE_INDENT "  < ")
list(APPEND count satu dua tiga)
foreach(i IN LISTS count)
    message(STATUS ${i})
endforeach()
list(POP_BACK CMAKE_MESSAGE_INDENT)

message(STATUS "foreach(IN LISTS and ITEMS):")
list(APPEND CMAKE_MESSAGE_INDENT "  < ")
foreach(i IN LISTS count ITEMS one two three)
    message(STATUS ${i})
endforeach()
list(POP_BACK CMAKE_MESSAGE_INDENT)

message(STATUS "foreach(IN ITEMS and LISTS):")
list(APPEND CMAKE_MESSAGE_INDENT "  < ")
foreach(i IN ITEMS one two three LISTS count)
    message(STATUS ${i})
endforeach()
list(POP_BACK CMAKE_MESSAGE_INDENT)