diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2019-12-19 13:46:50 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2020-01-20 20:49:29 (GMT) |
commit | 3ec82b713e51711df0c70f539aea62fc16dd3060 (patch) | |
tree | 90ce909e0cdc41e5308c83da1c03af9bbfdf1e8a /Tests/RunCMake/CMP0102/CMP0102-WARN.cmake | |
parent | 701a5c60e059a53ebf458174253811167c1ae3fc (diff) | |
download | CMake-3ec82b713e51711df0c70f539aea62fc16dd3060.zip CMake-3ec82b713e51711df0c70f539aea62fc16dd3060.tar.gz CMake-3ec82b713e51711df0c70f539aea62fc16dd3060.tar.bz2 |
cmMarkAsAdvancedCommand: ignore variables which don't exist in the cache
Fixes: #18331
Diffstat (limited to 'Tests/RunCMake/CMP0102/CMP0102-WARN.cmake')
-rw-r--r-- | Tests/RunCMake/CMP0102/CMP0102-WARN.cmake | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0102/CMP0102-WARN.cmake b/Tests/RunCMake/CMP0102/CMP0102-WARN.cmake new file mode 100644 index 0000000..e9a45f1 --- /dev/null +++ b/Tests/RunCMake/CMP0102/CMP0102-WARN.cmake @@ -0,0 +1,18 @@ + +set(CMAKE_POLICY_WARNING_CMP0102 1) + +include (CMP0102-Common.cmake) +get_property(is_type_set CACHE CMP0102_TEST_VARIABLE + PROPERTY TYPE SET) +if (NOT is_type_set) + message(FATAL_ERROR + "There is a cache entry for an undefined variable after " + "`mark_as_advanced`.") +endif () +get_property(type CACHE CMP0102_TEST_VARIABLE + PROPERTY TYPE) +if (NOT type STREQUAL "UNINITIALIZED") + message(FATAL_ERROR + "The cache type for CMP0102_TEST_VARIABLE is not " + "UNINITIALIZED") +endif () |