diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2020-05-28 11:51:22 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2020-06-02 15:11:47 (GMT) |
commit | 056489d567b657bd1ebeae8bf78f4937f900b2e0 (patch) | |
tree | d3800c8fdf726c1e04cf73e463b68861efe6abd3 /Source/cmGetTargetPropertyCommand.cxx | |
parent | 254f2b9058f814e952ef0178e13b3f98e8d216a1 (diff) | |
download | CMake-056489d567b657bd1ebeae8bf78f4937f900b2e0.zip CMake-056489d567b657bd1ebeae8bf78f4937f900b2e0.tar.gz CMake-056489d567b657bd1ebeae8bf78f4937f900b2e0.tar.bz2 |
add_library/add_executable: allow local alias to imported targets
Fixes: #20641
Diffstat (limited to 'Source/cmGetTargetPropertyCommand.cxx')
-rw-r--r-- | Source/cmGetTargetPropertyCommand.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx index e5a3669..8a304be 100644 --- a/Source/cmGetTargetPropertyCommand.cxx +++ b/Source/cmGetTargetPropertyCommand.cxx @@ -5,6 +5,7 @@ #include <sstream> #include "cmExecutionStatus.h" +#include "cmGlobalGenerator.h" #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -29,10 +30,17 @@ 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()) { cmProp prop_cstr = nullptr; |