mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-02 04:02:23 +03:00
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.
This commit is contained in:
1 parent
4790842612
commit
7c8f7737fd
1 file changed
+10
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user