diff options
author | Brad King <brad.king@kitware.com> | 2017-04-21 17:41:09 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-04-21 17:45:45 (GMT) |
commit | 81f9c9e892e6b4ee873361b3750a87760ebe8a2d (patch) | |
tree | 1ea0ed8107657eef4362cefa603bf3aab7da615d | |
parent | 294cf948dc37799e1980685afbf1fa585ad5b0fb (diff) | |
download | CMake-81f9c9e892e6b4ee873361b3750a87760ebe8a2d.zip CMake-81f9c9e892e6b4ee873361b3750a87760ebe8a2d.tar.gz CMake-81f9c9e892e6b4ee873361b3750a87760ebe8a2d.tar.bz2 |
Deprecate Visual Studio 8 2005 generator
Update documentation to mark the generator deprecated. Add a warning at
the end of generation plus an option to turn off the warning.
-rw-r--r-- | Help/generator/Visual Studio 8 2005.rst | 9 | ||||
-rw-r--r-- | Help/release/dev/vs8-deprecate.rst | 5 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 13 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/DeprecateVS8-WARN-OFF.cmake | 0 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/DeprecateVS8-WARN-ON-stderr.txt | 5 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/DeprecateVS8-WARN-ON.cmake | 0 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/RunCMake.cmake | 3 |
9 files changed, 42 insertions, 2 deletions
diff --git a/Help/generator/Visual Studio 8 2005.rst b/Help/generator/Visual Studio 8 2005.rst index 29012c3..acbbf01 100644 --- a/Help/generator/Visual Studio 8 2005.rst +++ b/Help/generator/Visual Studio 8 2005.rst @@ -1,7 +1,14 @@ Visual Studio 8 2005 -------------------- -Generates Visual Studio 8 2005 project files. +Deprecated. Generates Visual Studio 8 2005 project files. + +.. note:: + This generator is deprecated and will be removed in a future version + of CMake. It will still be possible to build with VS 8 2005 tools + using the :generator:`Visual Studio 10 2010` (or above) generator + with :variable:`CMAKE_GENERATOR_TOOLSET` set to ``v80``, or by + using the :generator:`NMake Makefiles` generator. The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set to specify a target platform name. diff --git a/Help/release/dev/vs8-deprecate.rst b/Help/release/dev/vs8-deprecate.rst new file mode 100644 index 0000000..97d996f --- /dev/null +++ b/Help/release/dev/vs8-deprecate.rst @@ -0,0 +1,5 @@ +vs8-deprecate +------------- + +* The :generator:`Visual Studio 8 2005` generator is now deprecated + and will be removed in a future version of CMake. diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 14ec72f..1b75a08 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -293,6 +293,19 @@ void cmGlobalVisualStudio7Generator::Generate() if (!cmSystemTools::GetErrorOccuredFlag()) { this->CallVisualStudioMacro(MacroReload); } + + if (this->Version == VS8 && !this->CMakeInstance->GetIsInTryCompile()) { + const char* cmakeWarnVS8 = + this->CMakeInstance->GetState()->GetCacheEntryValue("CMAKE_WARN_VS8"); + if (!cmakeWarnVS8 || !cmSystemTools::IsOff(cmakeWarnVS8)) { + this->CMakeInstance->IssueMessage( + cmake::WARNING, + "The \"Visual Studio 8 2005\" generator is deprecated " + "and will be removed in a future version of CMake." + "\n" + "Add CMAKE_WARN_VS8=OFF to the cache to disable this warning."); + } + } } void cmGlobalVisualStudio7Generator::OutputSLNFile( diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 1fcb5ac..7a42b72 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -54,7 +54,7 @@ public: void GetDocumentation(cmDocumentationEntry& entry) const CM_OVERRIDE { entry.Name = std::string(vs8generatorName) + " [arch]"; - entry.Brief = "Generates Visual Studio 2005 project files. " + entry.Brief = "Deprecated. Generates Visual Studio 2005 project files. " "Optional [arch] can be \"Win64\"."; } diff --git a/Tests/RunCMake/CommandLine/DeprecateVS8-WARN-OFF.cmake b/Tests/RunCMake/CommandLine/DeprecateVS8-WARN-OFF.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CommandLine/DeprecateVS8-WARN-OFF.cmake diff --git a/Tests/RunCMake/CommandLine/DeprecateVS8-WARN-ON-stderr.txt b/Tests/RunCMake/CommandLine/DeprecateVS8-WARN-ON-stderr.txt new file mode 100644 index 0000000..2f2cbd3 --- /dev/null +++ b/Tests/RunCMake/CommandLine/DeprecateVS8-WARN-ON-stderr.txt @@ -0,0 +1,5 @@ +^CMake Warning: + The "Visual Studio 8 2005" generator is deprecated and will be removed in a + future version of CMake. + + Add CMAKE_WARN_VS8=OFF to the cache to disable this warning.$ diff --git a/Tests/RunCMake/CommandLine/DeprecateVS8-WARN-ON.cmake b/Tests/RunCMake/CommandLine/DeprecateVS8-WARN-ON.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CommandLine/DeprecateVS8-WARN-ON.cmake diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index f327f78..f94b10a 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -78,6 +78,13 @@ if(RunCMake_GENERATOR STREQUAL "Ninja") unset(RunCMake_TEST_NO_CLEAN) endif() +if(RunCMake_GENERATOR MATCHES "^Visual Studio 8 2005") + set(RunCMake_WARN_VS8 1) + run_cmake(DeprecateVS8-WARN-ON) + unset(RunCMake_WARN_VS8) + run_cmake(DeprecateVS8-WARN-OFF) +endif() + if(UNIX) run_cmake_command(E_create_symlink-no-arg ${CMAKE_COMMAND} -E create_symlink diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 04eadd5..26312c4 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -51,6 +51,9 @@ function(run_cmake test) if(APPLE) list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0025=NEW) endif() + if(RunCMake_GENERATOR MATCHES "^Visual Studio 8 2005" AND NOT RunCMake_WARN_VS8) + list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_WARN_VS8=OFF) + endif() if(RunCMake_MAKE_PROGRAM) list(APPEND RunCMake_TEST_OPTIONS "-DCMAKE_MAKE_PROGRAM=${RunCMake_MAKE_PROGRAM}") endif() |