summaryrefslogtreecommitdiffstats
path: root/Source/cmGetTargetPropertyCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGetTargetPropertyCommand.cxx')
-rw-r--r--Source/cmGetTargetPropertyCommand.cxx17
1 files changed, 13 insertions, 4 deletions
diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx
index 7f5df9c..8a304be 100644
--- a/Source/cmGetTargetPropertyCommand.cxx
+++ b/Source/cmGetTargetPropertyCommand.cxx
@@ -5,10 +5,12 @@
#include <sstream>
#include "cmExecutionStatus.h"
+#include "cmGlobalGenerator.h"
#include "cmListFileCache.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
+#include "cmProperty.h"
#include "cmTarget.h"
#include "cmTargetPropertyComputer.h"
@@ -28,13 +30,20 @@ bool cmGetTargetPropertyCommand(std::vector<std::string> const& args,
cmMakefile& mf = status.GetMakefile();
if (cmTarget* tgt = mf.FindTargetToUse(targetName)) {
- if (args[2] == "ALIASED_TARGET") {
+ if (args[2] == "ALIASED_TARGET" || args[2] == "ALIAS_GLOBAL") {
if (mf.IsAlias(targetName)) {
- prop = tgt->GetName();
prop_exists = true;
+ if (args[2] == "ALIASED_TARGET") {
+
+ prop = tgt->GetName();
+ }
+ if (args[2] == "ALIAS_GLOBAL") {
+ prop =
+ mf.GetGlobalGenerator()->IsAlias(targetName) ? "TRUE" : "FALSE";
+ }
}
} else if (!args[2].empty()) {
- const char* prop_cstr = nullptr;
+ cmProp prop_cstr = nullptr;
cmListFileBacktrace bt = mf.GetBacktrace();
cmMessenger* messenger = mf.GetMessenger();
if (cmTargetPropertyComputer::PassesWhitelist(tgt->GetType(), args[2],
@@ -45,7 +54,7 @@ bool cmGetTargetPropertyCommand(std::vector<std::string> const& args,
}
}
if (prop_cstr) {
- prop = prop_cstr;
+ prop = *prop_cstr;
prop_exists = true;
}
}