diff options
author | Erik Christensen <christensen.erik@siemens.com> | 2016-11-14 22:38:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-11-15 15:40:55 (GMT) |
commit | 7c8f7737fd28d209cb871ac62bbd08ad738e2751 (patch) | |
tree | 97d41569b35ff2fdec054ea4e8a3fcab44405ab7 /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | 4790842612b445bc49ee7af4d44f71718e292d48 (diff) | |
download | CMake-7c8f7737fd28d209cb871ac62bbd08ad738e2751.zip CMake-7c8f7737fd28d209cb871ac62bbd08ad738e2751.tar.gz CMake-7c8f7737fd28d209cb871ac62bbd08ad738e2751.tar.bz2 |
VS: Disable project upgrade prompt on VS 2013 and above
When opening projects in Visual Studio that specify an older toolset
version, a prompt is displayed the first time asking the user whether to
upgrade the projects. This is meant for project files that are
maintained manually and updated through the IDE. For CMake-generated
projects this does not make sense, so add content to tell VS not to
upgrade.
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 5dd9e48..4dabd51 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -314,6 +314,16 @@ void cmVisualStudio10TargetGenerator::Generate() << "</TargetFrameworkVersion>\n"; } + // Disable the project upgrade prompt that is displayed the first time a + // project using an older toolset version is opened in a newer version of + // the IDE (respected by VS 2013 and above). + if (this->GlobalGenerator->GetVersion() >= + cmGlobalVisualStudioGenerator::VS12) { + this->WriteString("<VCProjectUpgraderObjectName>NoUpgrade" + "</VCProjectUpgraderObjectName>\n", + 2); + } + std::vector<std::string> keys = this->GeneratorTarget->GetPropertyKeys(); for (std::vector<std::string>::const_iterator keyIt = keys.begin(); keyIt != keys.end(); ++keyIt) { |