diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2018-11-02 21:27:09 (GMT) |
---|---|---|
committer | Robert Maynard <robert.maynard@kitware.com> | 2018-11-09 15:38:07 (GMT) |
commit | 1222f02e343e804f1fcc8ff09e56dc13ac233d98 (patch) | |
tree | 9e2a433430c3fd32b98ddf4d4f554eb69a103930 /Tests/Unset | |
parent | 9463d73cc4d58b190fac0cac6aeee424b5d29514 (diff) | |
download | CMake-1222f02e343e804f1fcc8ff09e56dc13ac233d98.zip CMake-1222f02e343e804f1fcc8ff09e56dc13ac233d98.tar.gz CMake-1222f02e343e804f1fcc8ff09e56dc13ac233d98.tar.bz2 |
If: Support the 'DEFINED CACHE{}' syntax
Diffstat (limited to 'Tests/Unset')
-rw-r--r-- | Tests/Unset/CMakeLists.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Tests/Unset/CMakeLists.txt b/Tests/Unset/CMakeLists.txt index 07aa68e..a40367b 100644 --- a/Tests/Unset/CMakeLists.txt +++ b/Tests/Unset/CMakeLists.txt @@ -21,17 +21,26 @@ set(x 43) if(NOT x EQUAL 43) message(FATAL_ERROR "x!=43") endif() +if(DEFINED CACHE{x}) + message(FATAL_ERROR "x shouldn't be found in the cache") +endif() + set(x) if(DEFINED x) message(FATAL_ERROR "x should be undefined now!") endif() + # Cache variable set(BAR "test" CACHE STRING "documentation") if(NOT DEFINED BAR) message(FATAL_ERROR "BAR not defined") endif() +if(NOT DEFINED CACHE{BAR}) + message(FATAL_ERROR "BAR could not be found by CACHE{BAR}") +endif() + # Test interaction of cache entries with variables. set(BAR "test-var") if(NOT "$CACHE{BAR}" STREQUAL "test") |