summaryrefslogtreecommitdiff
path: root/Source/cmGlobalVisualStudio7Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-09-27 11:05:53 -0400
committerBrad King <brad.king@kitware.com>2022-09-27 11:45:50 -0400
commit6c1337cb79341ec0f9aac617419b6311b6d601af (patch)
treeb7d19905b8138ef4b4e98c413cbf80e154f157fa /Source/cmGlobalVisualStudio7Generator.cxx
parent5faf145a5b31fc59bf3a9730efbf73d70faea50d (diff)
downloadcmake-6c1337cb79341ec0f9aac617419b6311b6d601af.tar.gz
Deprecate Visual Studio 11 2012 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 'Source/cmGlobalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 7bf3c3a902..ff76762cfa 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -303,6 +303,26 @@ void cmGlobalVisualStudio7Generator::Generate()
this->CallVisualStudioMacro(MacroReload,
GetSLNFile(this->LocalGenerators[0].get()));
}
+
+ if (this->Version == VSVersion::VS11 &&
+ !this->CMakeInstance->GetIsInTryCompile()) {
+ std::string cmakeWarnVS11;
+ if (cmValue cached = this->CMakeInstance->GetState()->GetCacheEntryValue(
+ "CMAKE_WARN_VS11")) {
+ this->CMakeInstance->MarkCliAsUsed("CMAKE_WARN_VS11");
+ cmakeWarnVS11 = *cached;
+ } else {
+ cmSystemTools::GetEnv("CMAKE_WARN_VS11", cmakeWarnVS11);
+ }
+ if (cmakeWarnVS11.empty() || !cmIsOff(cmakeWarnVS11)) {
+ this->CMakeInstance->IssueMessage(
+ MessageType::WARNING,
+ "The \"Visual Studio 11 2012\" generator is deprecated "
+ "and will be removed in a future version of CMake."
+ "\n"
+ "Add CMAKE_WARN_VS11=OFF to the cache to disable this warning.");
+ }
+ }
}
void cmGlobalVisualStudio7Generator::OutputSLNFile(