summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 9f6973e..ab66fd0 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1020,9 +1020,9 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup(Elem& e0)
cm::string_view tagName =
cm::string_view(p).substr(propNamePrefix.length());
if (!tagName.empty()) {
- const std::string& value = *props.GetPropertyValue(p);
- if (!value.empty()) {
- e2.Element(tagName, value);
+ cmProp value = props.GetPropertyValue(p);
+ if (cmNonempty(value)) {
+ e2.Element(tagName, *value);
}
}
}
@@ -4210,8 +4210,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0)
cmLocalGenerator* lg = dt->GetLocalGenerator();
std::string name = dt->GetName();
std::string path;
- cmProp p = dt->GetProperty("EXTERNAL_MSPROJECT");
- if (p) {
+ if (cmProp p = dt->GetProperty("EXTERNAL_MSPROJECT")) {
path = *p;
} else {
path = cmStrCat(lg->GetCurrentBinaryDirectory(), '/', dt->GetName(),
@@ -4999,9 +4998,9 @@ void cmVisualStudio10TargetGenerator::GetCSharpSourceProperties(
if (cmHasPrefix(p, propNamePrefix)) {
std::string tagName = p.substr(propNamePrefix.length());
if (!tagName.empty()) {
- const std::string& val = *props.GetPropertyValue(p);
- if (!val.empty()) {
- tags[tagName] = val;
+ cmProp val = props.GetPropertyValue(p);
+ if (cmNonempty(val)) {
+ tags[tagName] = *val;
} else {
tags.erase(tagName);
}