summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-06-24 18:37:59 (GMT)
committerBrad King <brad.king@kitware.com>2023-06-26 16:41:18 (GMT)
commit75b573a628d4296b237601d2a9cb4c0a05903f96 (patch)
tree78fcbfd433000147384888cccec59876d2c01d1a
parent61bb728c0c874b85620289fd233bd0deb741a27c (diff)
downloadCMake-75b573a628d4296b237601d2a9cb4c0a05903f96.zip
CMake-75b573a628d4296b237601d2a9cb4c0a05903f96.tar.gz
CMake-75b573a628d4296b237601d2a9cb4c0a05903f96.tar.bz2
Deprecate Visual Studio 12 2013 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 10 2010.rst2
-rw-r--r--Help/generator/Visual Studio 11 2012.rst2
-rw-r--r--Help/generator/Visual Studio 12 2013.rst9
-rw-r--r--Help/generator/Visual Studio 9 2008.rst2
-rw-r--r--Help/release/dev/vs12-deprecate.rst5
-rw-r--r--Source/cmGlobalVisualStudio12Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx20
-rw-r--r--Tests/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CommandLine/DeprecateVS12-WARN-OFF.cmake0
-rw-r--r--Tests/RunCMake/CommandLine/DeprecateVS12-WARN-ON-stderr.txt5
-rw-r--r--Tests/RunCMake/CommandLine/DeprecateVS12-WARN-ON.cmake0
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake7
12 files changed, 51 insertions, 5 deletions
diff --git a/Help/generator/Visual Studio 10 2010.rst b/Help/generator/Visual Studio 10 2010.rst
index 888164f..a36046a 100644
--- a/Help/generator/Visual Studio 10 2010.rst
+++ b/Help/generator/Visual Studio 10 2010.rst
@@ -3,6 +3,6 @@ Visual Studio 10 2010
Removed. This once generated Visual Studio 10 2010 project files, but
the generator has been removed since CMake 3.25. It is still possible
-to build with VS 10 2010 tools using the :generator:`Visual Studio 12 2013`
+to build with VS 10 2010 tools using the :generator:`Visual Studio 14 2015`
(or above) generator with :variable:`CMAKE_GENERATOR_TOOLSET` set to
``v100``, or by using the :generator:`NMake Makefiles` generator.
diff --git a/Help/generator/Visual Studio 11 2012.rst b/Help/generator/Visual Studio 11 2012.rst
index fd8c314..5ded24c 100644
--- a/Help/generator/Visual Studio 11 2012.rst
+++ b/Help/generator/Visual Studio 11 2012.rst
@@ -3,6 +3,6 @@ Visual Studio 11 2012
Removed. This once generated Visual Studio 11 2012 project files, but
the generator has been removed since CMake 3.28. It is still possible
-to build with VS 11 2012 tools using the :generator:`Visual Studio 12 2013`
+to build with VS 11 2012 tools using the :generator:`Visual Studio 14 2015`
(or above) generator with :variable:`CMAKE_GENERATOR_TOOLSET` set to ``v110``,
or by using the :generator:`NMake Makefiles` generator.
diff --git a/Help/generator/Visual Studio 12 2013.rst b/Help/generator/Visual Studio 12 2013.rst
index 3dbcfe6..522522c 100644
--- a/Help/generator/Visual Studio 12 2013.rst
+++ b/Help/generator/Visual Studio 12 2013.rst
@@ -1,7 +1,14 @@
Visual Studio 12 2013
---------------------
-Generates Visual Studio 12 (VS 2013) project files.
+Deprecated. Generates Visual Studio 12 (VS 2013) 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 12 2013 tools
+ using the :generator:`Visual Studio 14 2015` (or above) generator
+ with :variable:`CMAKE_GENERATOR_TOOLSET` set to ``v120``, or by
+ using the :generator:`NMake Makefiles` generator.
For compatibility with CMake versions prior to 3.0, one may specify this
generator using the name "Visual Studio 12" without the year component.
diff --git a/Help/generator/Visual Studio 9 2008.rst b/Help/generator/Visual Studio 9 2008.rst
index 816969d..1439270 100644
--- a/Help/generator/Visual Studio 9 2008.rst
+++ b/Help/generator/Visual Studio 9 2008.rst
@@ -6,7 +6,7 @@ Deprecated. Generates Visual Studio 9 2008 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 9 2008 tools
- using the :generator:`Visual Studio 12 2013` generator (or above,
+ using the :generator:`Visual Studio 14 2015` generator (or above,
and with VS 10 2010 also installed) with
:variable:`CMAKE_GENERATOR_TOOLSET` set to ``v90``,
or by using the :generator:`NMake Makefiles` generator.
diff --git a/Help/release/dev/vs12-deprecate.rst b/Help/release/dev/vs12-deprecate.rst
new file mode 100644
index 0000000..23d7e2a
--- /dev/null
+++ b/Help/release/dev/vs12-deprecate.rst
@@ -0,0 +1,5 @@
+vs12-deprecate
+--------------
+
+* The :generator:`Visual Studio 12 2013` generator is now deprecated
+ and will be removed in a future version of CMake.
diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx
index d417f9e..b7af31b 100644
--- a/Source/cmGlobalVisualStudio12Generator.cxx
+++ b/Source/cmGlobalVisualStudio12Generator.cxx
@@ -64,7 +64,7 @@ public:
cmDocumentationEntry GetDocumentation() const override
{
return { std::string(vs12generatorName) + " [arch]",
- "Generates Visual Studio 2013 project files. "
+ "Deprecated. Generates Visual Studio 2013 project files. "
"Optional [arch] can be \"Win64\" or \"ARM\"." };
}
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 62c0b5b..203bb09 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -329,6 +329,26 @@ void cmGlobalVisualStudio7Generator::Generate()
"Add CMAKE_WARN_VS9=OFF to the cache to disable this warning.");
}
}
+
+ if (this->Version == VSVersion::VS12 &&
+ !this->CMakeInstance->GetIsInTryCompile()) {
+ std::string cmakeWarnVS12;
+ if (cmValue cached = this->CMakeInstance->GetState()->GetCacheEntryValue(
+ "CMAKE_WARN_VS12")) {
+ this->CMakeInstance->MarkCliAsUsed("CMAKE_WARN_VS12");
+ cmakeWarnVS12 = *cached;
+ } else {
+ cmSystemTools::GetEnv("CMAKE_WARN_VS12", cmakeWarnVS12);
+ }
+ if (cmakeWarnVS12.empty() || !cmIsOff(cmakeWarnVS12)) {
+ this->CMakeInstance->IssueMessage(
+ MessageType::WARNING,
+ "The \"Visual Studio 12 2013\" generator is deprecated "
+ "and will be removed in a future version of CMake."
+ "\n"
+ "Add CMAKE_WARN_VS12=OFF to the cache to disable this warning.");
+ }
+ }
}
void cmGlobalVisualStudio7Generator::OutputSLNFile(
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 8e6017e..914ebce 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -42,6 +42,8 @@ endif()
# Suppress generator deprecation warnings in test suite.
if(CMAKE_GENERATOR MATCHES "^Visual Studio 9 2008")
set(TEST_WARN_VS_CODE "set(ENV{CMAKE_WARN_VS9} OFF)")
+elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 12 2013")
+ set(TEST_WARN_VS_CODE "set(ENV{CMAKE_WARN_VS12} OFF)")
else()
set(TEST_WARN_VS_CODE "")
endif()
diff --git a/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-OFF.cmake b/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-OFF.cmake
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-OFF.cmake
diff --git a/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-ON-stderr.txt b/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-ON-stderr.txt
new file mode 100644
index 0000000..b69408e
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-ON-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Warning:
+ The "Visual Studio 12 2013" generator is deprecated and will be removed in
+ a future version of CMake.
+
+ Add CMAKE_WARN_VS12=OFF to the cache to disable this warning.$
diff --git a/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-ON.cmake b/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-ON.cmake
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-ON.cmake
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 53f13e4..611dde2 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -1118,3 +1118,10 @@ if(RunCMake_GENERATOR MATCHES "^Visual Studio 9 2008")
run_cmake(DeprecateVS9-WARN-ON)
run_cmake_with_options(DeprecateVS9-WARN-OFF -DCMAKE_WARN_VS9=OFF)
endif()
+
+if(RunCMake_GENERATOR MATCHES "^Visual Studio 12 2013")
+ run_cmake_with_options(DeprecateVS12-WARN-ON -DCMAKE_WARN_VS12=ON)
+ unset(ENV{CMAKE_WARN_VS12})
+ run_cmake(DeprecateVS12-WARN-ON)
+ run_cmake_with_options(DeprecateVS12-WARN-OFF -DCMAKE_WARN_VS12=OFF)
+endif()