summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Fitzgerald <michaeljohnfitzgerald@gmail.com>2016-01-08 22:33:28 (GMT)
committerBrad King <brad.king@kitware.com>2016-01-11 18:04:34 (GMT)
commitaf39f11521af7fc2ec037103df1ad5a616dd7f19 (patch)
tree9525ac5a65b7388987b765cc98e9ea40d904048c
parentcedbb7994dddce2c3fdf846bf4563c846adf4632 (diff)
downloadCMake-af39f11521af7fc2ec037103df1ad5a616dd7f19.zip
CMake-af39f11521af7fc2ec037103df1ad5a616dd7f19.tar.gz
CMake-af39f11521af7fc2ec037103df1ad5a616dd7f19.tar.bz2
VS: Implement VS_GLOBAL_* target properties in VS 2010+ (#13666)
These have been documented but previously only implemented for VS 2008 and below.
-rw-r--r--Help/release/dev/vs-global-properties.rst5
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx26
2 files changed, 31 insertions, 0 deletions
diff --git a/Help/release/dev/vs-global-properties.rst b/Help/release/dev/vs-global-properties.rst
new file mode 100644
index 0000000..cae49b7
--- /dev/null
+++ b/Help/release/dev/vs-global-properties.rst
@@ -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.
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 669c785..c9705ac 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -448,6 +448,32 @@ void cmVisualStudio10TargetGenerator::Generate()
(*this->BuildFileStream) << cmVS10EscapeXML(targetFrameworkVersion)
<< "</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("<Import Project="
"\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n",