blob: 1c12bc1984f698061d7491a6f189881f3eb7c752 (
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
function(FUNC1)
set(VAR1 "set")
unset(VAR2)
return(PROPAGATE VAR1 VAR2)
endfunction()
set(VAR1 "initial")
set(VAR2 "initial")
func1()
if((NOT DEFINED VAR1 OR NOT VAR1 STREQUAL "set")
OR DEFINED VAR2)
message(SEND_ERROR "erroneous propagation for FUNC1")
endif()
function(FUNC2)
block()
set(VAR1 "set")
unset(VAR2)
return(PROPAGATE VAR1 VAR2)
endblock()
endfunction()
set(VAR1 "initial")
set(VAR2 "initial")
func2()
if((NOT DEFINED VAR1 OR NOT VAR1 STREQUAL "set")
OR DEFINED VAR2)
message(SEND_ERROR "erroneous propagation for FUNC2")
endif()
function(FUNC3)
block(SCOPE_FOR POLICIES)
set(VAR1 "set")
unset(VAR2)
return(PROPAGATE VAR1 VAR2)
endblock()
endfunction()
set(VAR1 "initial")
set(VAR2 "initial")
func3()
if((NOT DEFINED VAR1 OR NOT VAR1 STREQUAL "set")
OR DEFINED VAR2)
message(SEND_ERROR "erroneous propagation for FUNC3")
endif()
function(FUNC4)
while(TRUE)
set(VAR1 "set")
unset(VAR2)
return(PROPAGATE VAR1 VAR2)
endwhile()
endfunction()
set(VAR1 "initial")
set(VAR2 "initial")
func4()
if((NOT DEFINED VAR1 OR NOT VAR1 STREQUAL "set")
OR DEFINED VAR2)
message(SEND_ERROR "erroneous propagation for FUNC4")
endif()
function(FUNC5)
foreach(item IN ITEMS A B)
set(VAR1 "set")
unset(VAR2)
return(PROPAGATE VAR1 VAR2)
endforeach()
endfunction()
set(VAR1 "initial")
set(VAR2 "initial")
func5()
if((NOT DEFINED VAR1 OR NOT VAR1 STREQUAL "set")
OR DEFINED VAR2)
message(SEND_ERROR "erroneous propagation for FUNC5")
endif()
function(FUNC6)
if(TRUE)
set(VAR1 "set")
unset(VAR2)
return(PROPAGATE VAR1 VAR2)
endif()
endfunction()
set(VAR1 "initial")
set(VAR2 "initial")
func6()
if((NOT DEFINED VAR1 OR NOT VAR1 STREQUAL "set")
OR DEFINED VAR2)
message(SEND_ERROR "erroneous propagation for FUNC6")
endif()
function(FUNC7)
if(FALSE)
else()
set(VAR1 "set")
unset(VAR2)
return(PROPAGATE VAR1 VAR2)
endif()
endfunction()
set(VAR1 "initial")
set(VAR2 "initial")
func7()
if((NOT DEFINED VAR1 OR NOT VAR1 STREQUAL "set")
OR DEFINED VAR2)
message(SEND_ERROR "erroneous propagation for FUNC7")
endif()
set(VAR1 "initial")
set(VAR2 "initial")
cmake_language(CALL func7)
if((NOT DEFINED VAR1 OR NOT VAR1 STREQUAL "set")
OR DEFINED VAR2)
message(SEND_ERROR "erroneous propagation for cmake_language(CALL FUNC7)")
endif()
set(VAR1 "initial")
set(VAR2 "initial")
cmake_language(EVAL CODE "
function(FUNC8)
set(VAR1 \"set\")
unset(VAR2)
return(PROPAGATE VAR1 VAR2)
endfunction()
func8()")
if((NOT DEFINED VAR1 OR NOT VAR1 STREQUAL "set")
OR DEFINED VAR2)
message(SEND_ERROR "erroneous propagation for cmake_language(EVAL CODE)")
endif()
|