VS: Implement VS_GLOBAL_* target properties in VS 2010+ (#13666)
These have been documented but previously only implemented for VS 2008 and below.
This commit is contained in:
parent
cedbb7994d
commit
af39f11521
|
@ -0,0 +1,5 @@
|
||||||
|
vs-global-properties
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
* The :prop_tgt:`VS_GLOBAL_<variable>` target property is now implemented
|
||||||
|
for VS 2010 and above. Previously it worked only in VS 2008 and below.
|
|
@ -448,6 +448,32 @@ void cmVisualStudio10TargetGenerator::Generate()
|
||||||
(*this->BuildFileStream) << cmVS10EscapeXML(targetFrameworkVersion)
|
(*this->BuildFileStream) << cmVS10EscapeXML(targetFrameworkVersion)
|
||||||
<< "</TargetFrameworkVersion>\n";
|
<< "</TargetFrameworkVersion>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> keys = this->GeneratorTarget->GetPropertyKeys();
|
||||||
|
for(std::vector<std::string>::const_iterator keyIt = keys.begin();
|
||||||
|
keyIt != keys.end(); ++keyIt)
|
||||||
|
{
|
||||||
|
static const char* prefix = "VS_GLOBAL_";
|
||||||
|
if(keyIt->find(prefix) != 0)
|
||||||
|
continue;
|
||||||
|
std::string globalKey = keyIt->substr(strlen(prefix));
|
||||||
|
// Skip invalid or separately-handled properties.
|
||||||
|
if(globalKey == "" ||
|
||||||
|
globalKey == "PROJECT_TYPES" ||
|
||||||
|
globalKey == "ROOTNAMESPACE" ||
|
||||||
|
globalKey == "KEYWORD")
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const char* value = this->GeneratorTarget->GetProperty(keyIt->c_str());
|
||||||
|
if (!value)
|
||||||
|
continue;
|
||||||
|
this->WriteString("<", 2);
|
||||||
|
(*this->BuildFileStream) << globalKey << ">"
|
||||||
|
<< cmVS10EscapeXML(value)
|
||||||
|
<< "</" << globalKey << ">\n";
|
||||||
|
}
|
||||||
|
|
||||||
this->WriteString("</PropertyGroup>\n", 1);
|
this->WriteString("</PropertyGroup>\n", 1);
|
||||||
this->WriteString("<Import Project="
|
this->WriteString("<Import Project="
|
||||||
"\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n",
|
"\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n",
|
||||||
|
|
Loading…
Reference in New Issue