summaryrefslogtreecommitdiffstats
path: root/Source/cmGetPropertyCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGetPropertyCommand.cxx')
-rw-r--r--Source/cmGetPropertyCommand.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx
index 3a5b39d..e755399 100644
--- a/Source/cmGetPropertyCommand.cxx
+++ b/Source/cmGetPropertyCommand.cxx
@@ -280,8 +280,9 @@ bool HandleGlobalMode(cmExecutionStatus& status, const std::string& name,
// Get the property.
cmake* cm = status.GetMakefile().GetCMakeInstance();
- cmProp p = cm->GetState()->GetGlobalProperty(propertyName);
- return StoreResult(infoType, status.GetMakefile(), variable, cmToCStr(p));
+ return StoreResult(
+ infoType, status.GetMakefile(), variable,
+ cmToCStr(cm->GetState()->GetGlobalProperty(propertyName)));
}
bool HandleDirectoryMode(cmExecutionStatus& status, const std::string& name,
@@ -327,8 +328,8 @@ bool HandleDirectoryMode(cmExecutionStatus& status, const std::string& name,
}
// Get the property.
- cmProp p = mf->GetProperty(propertyName);
- return StoreResult(infoType, status.GetMakefile(), variable, cmToCStr(p));
+ return StoreResult(infoType, status.GetMakefile(), variable,
+ cmToCStr(mf->GetProperty(propertyName)));
}
bool HandleTargetMode(cmExecutionStatus& status, const std::string& name,
@@ -358,15 +359,14 @@ bool HandleTargetMode(cmExecutionStatus& status, const std::string& name,
}
return StoreResult(infoType, status.GetMakefile(), variable, nullptr);
}
- cmProp prop_cstr = nullptr;
cmListFileBacktrace bt = status.GetMakefile().GetBacktrace();
cmMessenger* messenger = status.GetMakefile().GetMessenger();
- prop_cstr = target->GetComputedProperty(propertyName, messenger, bt);
- if (!prop_cstr) {
- prop_cstr = target->GetProperty(propertyName);
+ cmProp prop = target->GetComputedProperty(propertyName, messenger, bt);
+ if (!prop) {
+ prop = target->GetProperty(propertyName);
}
return StoreResult(infoType, status.GetMakefile(), variable,
- prop_cstr ? prop_cstr->c_str() : nullptr);
+ cmToCStr(prop));
}
status.SetError(cmStrCat("could not find TARGET ", name,
". Perhaps it has not yet been created."));
@@ -391,7 +391,7 @@ bool HandleSourceMode(cmExecutionStatus& status, const std::string& name,
if (cmSourceFile* sf =
directory_makefile.GetOrCreateSource(source_file_absolute_path)) {
return StoreResult(infoType, status.GetMakefile(), variable,
- sf->GetPropertyForUser(propertyName));
+ cmToCStr(sf->GetPropertyForUser(propertyName)));
}
status.SetError(
cmStrCat("given SOURCE name that could not be found or created: ",