diff options
author | Brad King <brad.king@kitware.com> | 2019-05-17 13:37:22 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-05-17 13:37:33 (GMT) |
commit | 21f5ed80918507dc3a9dcd0b617ded901d6db74e (patch) | |
tree | c7886320df10e9dcaaeab7c52890bf8a12a6dc08 /Tests | |
parent | acc2f022bb538cbd61621f66d64d13b751d23f39 (diff) | |
parent | eda3963615e64f180e452b6e4bd1cce7f9fb14a9 (diff) | |
download | CMake-21f5ed80918507dc3a9dcd0b617ded901d6db74e.zip CMake-21f5ed80918507dc3a9dcd0b617ded901d6db74e.tar.gz CMake-21f5ed80918507dc3a9dcd0b617ded901d6db74e.tar.bz2 |
Merge topic 'use_additional_clean_files'
eda3963615 UseSWIG: Use ADDITIONAL_CLEAN_FILES for cleaning
8c47be28cc UseJava: Use ADDITIONAL_CLEAN_FILES for cleaning
ac86c02d1b UseEcos: Use ADDITIONAL_CLEAN_FILES for cleaning
2532e00339 FindDoxygen: Use ADDITIONAL_CLEAN_FILES for cleaning
4edc0ef359 Test: Improve WarnUnusedCliUnused to run on all generators
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3328
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 29 | ||||
-rw-r--r-- | Tests/WarnUnusedCliUnused/CMakeLists.txt | 8 |
2 files changed, 15 insertions, 22 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index d992986..852b00f 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2525,24 +2525,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release FAIL_REGULAR_EXPRESSION "CMakeLists.txt:5 \\(set\\):") list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset") - if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND NOT WIN32) - # Ninja does not support ADDITIONAL_MAKE_CLEAN_FILES and therefore fails - # this test. (See #13371) - # Apparently Visual Studio does not support it either. As the MakeClean - # test above is only run with the Makefiles generator, only run this - # test with the Makefiles generator also. - add_test(WarnUnusedCliUnused ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/WarnUnusedCliUnused" - "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused" - ${build_generator_args} - --build-project WarnUnusedCliUnused - --build-options ${build_options} - "-DUNUSED_CLI_VARIABLE=Unused") - set_tests_properties(WarnUnusedCliUnused PROPERTIES - PASS_REGULAR_EXPRESSION "CMake Warning:.*Manually-specified variables were not used by the project:.* UNUSED_CLI_VARIABLE") - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused") - endif() + add_test(WarnUnusedCliUnused ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/WarnUnusedCliUnused" + "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused" + ${build_generator_args} + --build-project WarnUnusedCliUnused + --build-options ${build_options} + "-DUNUSED_CLI_VARIABLE=Unused") + set_tests_properties(WarnUnusedCliUnused PROPERTIES + PASS_REGULAR_EXPRESSION "CMake Warning:.*Manually-specified variables were not used by the project:.* UNUSED_CLI_VARIABLE") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused") add_test(WarnUnusedCliUsed ${CMAKE_CTEST_COMMAND} --build-and-test 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) |