diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-05-15 10:36:27 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-05-15 13:28:37 (GMT) |
commit | 4edc0ef359578ddaa7db0163e3a6097e12530c9b (patch) | |
tree | df9b3e29e78bc5835037c2d63af61d15fb787217 /Tests/WarnUnusedCliUnused | |
parent | 66efdbd21a46b63572f5de677ed126a68e524e7a (diff) | |
download | CMake-4edc0ef359578ddaa7db0163e3a6097e12530c9b.zip CMake-4edc0ef359578ddaa7db0163e3a6097e12530c9b.tar.gz CMake-4edc0ef359578ddaa7db0163e3a6097e12530c9b.tar.bz2 |
Test: Improve WarnUnusedCliUnused to run on all generators
In the WarnUnusedCliUnused test, the whole CMakeCache.txt was removed in the
clean stage to trigger the same CMake warning in re-builds. This technique
worked only in the Makefile generators and the test was limited to these.
Now only the variable of interest is removed from the cache by using a
`unset(UNUSED_CLI_VARIABLE CACHE)` statement in the CMakeLists.txt file.
This makes the WarnUnusedCliUnused test run on all generators
Diffstat (limited to 'Tests/WarnUnusedCliUnused')
-rw-r--r-- | Tests/WarnUnusedCliUnused/CMakeLists.txt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Tests/WarnUnusedCliUnused/CMakeLists.txt b/Tests/WarnUnusedCliUnused/CMakeLists.txt index 7ed69bf..a149f04 100644 --- a/Tests/WarnUnusedCliUnused/CMakeLists.txt +++ b/Tests/WarnUnusedCliUnused/CMakeLists.txt @@ -1,9 +1,9 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.14) project(WarnUnusedCliUnused) -set_directory_properties(PROPERTIES - ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_BINARY_DIR}/CMakeCache.txt" -) +# Remove UNUSED_CLI_VARIABLE from the cache to trigger the +# CMake warning message on re-builds as well. +unset(UNUSED_CLI_VARIABLE CACHE) add_library(dummy empty.cpp) |