summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-06-14 16:43:24 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-06-14 16:43:34 (GMT)
commitc8b4da583878177099b3aa9c6eb895f968ccf11a (patch)
treef777eb2b907ad6f6ef65ffbc45467d85eaa758ee /Source/cmVisualStudio10TargetGenerator.cxx
parentb0835fefd27dbb261397ac9fe3b9ab49a107966c (diff)
parent07ec212ae8d55cd20c315a8e73bd358762f3f959 (diff)
downloadCMake-c8b4da583878177099b3aa9c6eb895f968ccf11a.zip
CMake-c8b4da583878177099b3aa9c6eb895f968ccf11a.tar.gz
CMake-c8b4da583878177099b3aa9c6eb895f968ccf11a.tar.bz2
Merge topic 'vs-dotnet-custom-reference-tags'
07ec212a VS: add target property VS_DOTNET_REFERENCEPROP_<refname>_TAG_<tagname> Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !960
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx31
1 files changed, 31 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 29a06b7..b644405 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -658,9 +658,39 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReference(
this->WriteString("<HintPath>", 3);
(*this->BuildFileStream) << hint << "</HintPath>\n";
}
+ this->WriteDotNetReferenceCustomTags(ref);
this->WriteString("</Reference>\n", 2);
}
+void cmVisualStudio10TargetGenerator::WriteDotNetReferenceCustomTags(
+ std::string const& ref)
+{
+
+ static const std::string refpropPrefix = "VS_DOTNET_REFERENCEPROP_";
+ static const std::string refpropInfix = "_TAG_";
+ const std::string refPropFullPrefix = refpropPrefix + ref + refpropInfix;
+ typedef std::map<std::string, std::string> CustomTags;
+ CustomTags tags;
+ cmPropertyMap const& props = this->GeneratorTarget->Target->GetProperties();
+ for (cmPropertyMap::const_iterator i = props.begin(); i != props.end();
+ ++i) {
+ if (i->first.find(refPropFullPrefix) == 0) {
+ std::string refTag = i->first.substr(refPropFullPrefix.length());
+ std::string refVal = i->second.GetValue();
+ if (!refTag.empty() && !refVal.empty()) {
+ tags[refTag] = refVal;
+ }
+ }
+ }
+ for (CustomTags::const_iterator tag = tags.begin(); tag != tags.end();
+ ++tag) {
+ this->WriteString("<", 3);
+ (*this->BuildFileStream) << tag->first << ">"
+ << cmVS10EscapeXML(tag->second) << "</"
+ << tag->first << ">\n";
+ }
+}
+
void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup()
{
std::vector<cmSourceFile const*> resxObjs;
@@ -3500,6 +3530,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences()
(*this->BuildFileStream) << "</Project>\n";
this->WriteString("<Name>", 3);
(*this->BuildFileStream) << name << "</Name>\n";
+ this->WriteDotNetReferenceCustomTags(name);
this->WriteString("</ProjectReference>\n", 2);
}
this->WriteString("</ItemGroup>\n", 1);