File: CacheSetUnset.cmake

package info (click to toggle)
cmake 4.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 152,344 kB
  • sloc: ansic: 403,894; cpp: 303,807; sh: 4,097; python: 3,582; yacc: 3,106; lex: 1,279; f90: 538; asm: 471; lisp: 375; cs: 270; java: 266; fortran: 239; objc: 215; perl: 213; xml: 198; makefile: 108; javascript: 83; pascal: 63; tcl: 55; php: 25; ruby: 22
file content (73 lines) | stat: -rw-r--r-- 2,613 bytes parent folder | download | duplicates (2)
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
set(CACHE{VAR1} VALUE v1 v2)
if(NOT DEFINED CACHE{VAR1})
  message(SEND_ERROR "CACHE{VAR1} not defined")
endif()
get_property(type CACHE VAR1 PROPERTY TYPE)
if(NOT type STREQUAL "STRING")
  message(SEND_ERROR "CACHE{VAR1} TYPE should be \"STRING\", not \"${type}\"")
endif()
set(CACHE{VAR1} VALUE v3 v4)
if(NOT "$CACHE{VAR1}" STREQUAL "v1;v2")
  message(SEND_ERROR "CACHE{VAR1} value should be \"v1;v2\", not \"$CACHE{VAR1}\"")
endif()
set(CACHE{VAR1} FORCE VALUE v3 v4)
if(NOT "$CACHE{VAR1}" STREQUAL "v3;v4")
  message(SEND_ERROR "CACHE{VAR1} value should be \"v3;v4\", not \"$CACHE{VAR1}\"")
endif()
set(CACHE{VAR1} FORCE VALUE)
if(NOT DEFINED CACHE{VAR1})
  message(SEND_ERROR "CACHE{VAR1} not defined")
endif()
if(NOT "$CACHE{VAR1}" STREQUAL "")
  message(SEND_ERROR "CACHE{VAR1} value should be \"\", not \"$CACHE{VAR1}\"")
endif()
unset(CACHE{VAR1})
if(DEFINED CACHE{VAR1})
  message(SEND_ERROR "CACHE{VAR1} defined")
endif()

set(CACHE{VAR2} TYPE PATH HELP "help1 " "help2" VALUE v1 v2)
if(NOT DEFINED CACHE{VAR2})
  message(SEND_ERROR "CACHE{VAR2} not defined")
endif()
get_property(type CACHE VAR2 PROPERTY TYPE)
if(NOT type STREQUAL "PATH")
  message(SEND_ERROR "CACHE{VAR2} TYPE should be \"PATH\", not \"${type}\"")
endif()
get_property(help CACHE VAR2 PROPERTY HELPSTRING)
if(NOT help STREQUAL "help1 help2")
  message(SEND_ERROR "CACHE{VAR2} HELP should be \"help1 help2\", not \"${help}\"")
endif()
if(NOT "$CACHE{VAR2}" STREQUAL "v1;v2")
  message(SEND_ERROR "CACHE{VAR2} value should be \"v1;v2\", not \"$CACHE{VAR2}\"")
endif()
set(CACHE{VAR2} FORCE VALUE v3 v4)
if(NOT "$CACHE{VAR2}" STREQUAL "v3;v4")
  message(SEND_ERROR "CACHE{VAR2} value should be \"v3;v4\", not \"$CACHE{VAR2}\"")
endif()
get_property(type CACHE VAR2 PROPERTY TYPE)
if(NOT type STREQUAL "PATH")
  message(SEND_ERROR "CACHE{VAR2} TYPE should be \"PATH\", not \"${type}\"")
endif()
get_property(help CACHE VAR2 PROPERTY HELPSTRING)
if(NOT help STREQUAL "help1 help2")
  message(SEND_ERROR "CACHE{VAR2} HELP should be \"help1 help2\", not \"${help}\"")
endif()
unset(CACHE{VAR2})
if(DEFINED CACHE{VAR2})
  message(SEND_ERROR "CACHE{VAR2} defined")
endif()


set(CACHE{VAR3} TYPE INTERNAL HELP "help" VALUE v1 v2)
if(NOT DEFINED CACHE{VAR3})
  message(SEND_ERROR "CACHE{VAR3} not defined")
endif()
set(CACHE{VAR3} VALUE v3 v4)
if(NOT "$CACHE{VAR3}" STREQUAL "v3;v4")
  message(SEND_ERROR "CACHE{VAR3} value should be \"v3;v4\", not \"$CACHE{VAR3}\"")
endif()
get_property(type CACHE VAR3 PROPERTY TYPE)
if(NOT type STREQUAL "INTERNAL")
  message(SEND_ERROR "CACHE{VAR3} TYPE should be \"INTERNAL\", not \"${type}\"")
endif()