diff options
author | Brad King <brad.king@kitware.com> | 2021-07-29 15:49:27 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-07-29 18:15:01 (GMT) |
commit | 22dab6eb96438b8563079c44d00c520df5b04a6e (patch) | |
tree | 89da2b615d0fba53f87c73c264a8a3f6eac3021f /Tests | |
parent | 9251205512c49bbdda5d82f48126dc5b8e79d70f (diff) | |
download | CMake-22dab6eb96438b8563079c44d00c520df5b04a6e.zip CMake-22dab6eb96438b8563079c44d00c520df5b04a6e.tar.gz CMake-22dab6eb96438b8563079c44d00c520df5b04a6e.tar.bz2 |
Deprecate Visual Studio 10 2010 generator
Update documentation to mark the generator deprecated. Add a warning at
the end of generation plus an option to turn off the warning.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 7 | ||||
-rw-r--r-- | Tests/EnforceConfig.cmake.in | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/DeprecateVS10-WARN-OFF.cmake | 0 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/DeprecateVS10-WARN-ON-stderr.txt | 5 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/DeprecateVS10-WARN-ON.cmake | 0 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 7 |
6 files changed, 20 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 388ff20..ef8c846 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -39,6 +39,13 @@ set(ENV{HOME} \"${TEST_HOME}\") ") endif() +# Suppress generator deprecation warnings in test suite. +if(CMAKE_GENERATOR MATCHES "^Visual Studio 10 2010") + set(TEST_WARN_VS10_CODE "set(ENV{CMAKE_WARN_VS10} OFF)") +else() + set(TEST_WARN_VS10_CODE "") +endif() + # 3.9 or later provides a definitive answer to whether we are multi-config # through a global property. Prior to 3.9, CMAKE_CONFIGURATION_TYPES being set # is assumed to mean multi-config, but developers might modify it so it is diff --git a/Tests/EnforceConfig.cmake.in b/Tests/EnforceConfig.cmake.in index 7781ded..7c6f76a 100644 --- a/Tests/EnforceConfig.cmake.in +++ b/Tests/EnforceConfig.cmake.in @@ -36,3 +36,4 @@ unset(ENV{CMAKE_GENERATOR_TOOLSET}) unset(ENV{CMAKE_EXPORT_COMPILE_COMMANDS}) @TEST_HOME_ENV_CODE@ +@TEST_WARN_VS10_CODE@ diff --git a/Tests/RunCMake/CommandLine/DeprecateVS10-WARN-OFF.cmake b/Tests/RunCMake/CommandLine/DeprecateVS10-WARN-OFF.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CommandLine/DeprecateVS10-WARN-OFF.cmake diff --git a/Tests/RunCMake/CommandLine/DeprecateVS10-WARN-ON-stderr.txt b/Tests/RunCMake/CommandLine/DeprecateVS10-WARN-ON-stderr.txt new file mode 100644 index 0000000..202ef80 --- /dev/null +++ b/Tests/RunCMake/CommandLine/DeprecateVS10-WARN-ON-stderr.txt @@ -0,0 +1,5 @@ +^CMake Warning: + The "Visual Studio 10 2010" generator is deprecated and will be removed in + a future version of CMake. + + Add CMAKE_WARN_VS10=OFF to the cache to disable this warning.$ diff --git a/Tests/RunCMake/CommandLine/DeprecateVS10-WARN-ON.cmake b/Tests/RunCMake/CommandLine/DeprecateVS10-WARN-ON.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CommandLine/DeprecateVS10-WARN-ON.cmake diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 0b26b89..cea5b1b 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -918,3 +918,10 @@ set(ProfilingTestOutput ${RunCMake_TEST_BINARY_DIR}/output.json) set(RunCMake_TEST_OPTIONS --profiling-format=google-trace --profiling-output=${ProfilingTestOutput}) run_cmake(ProfilingTest) unset(RunCMake_TEST_OPTIONS) + +if(RunCMake_GENERATOR MATCHES "^Visual Studio 10 2010") + run_cmake_with_options(DeprecateVS10-WARN-ON -DCMAKE_WARN_VS10=ON) + unset(ENV{CMAKE_WARN_VS10}) + run_cmake(DeprecateVS10-WARN-ON) + run_cmake_with_options(DeprecateVS10-WARN-OFF -DCMAKE_WARN_VS10=OFF) +endif() |