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/cmGetPropertyCommand.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/cmGetPropertyCommand.cxx')
-rw-r--r-- | Source/cmGetPropertyCommand.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index 851f426..cba7704 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -344,10 +344,20 @@ bool HandleTargetMode(cmExecutionStatus& status, const std::string& name, } if (cmTarget* target = status.GetMakefile().FindTargetToUse(name)) { - if (propertyName == "ALIASED_TARGET") { + if (propertyName == "ALIASED_TARGET" || propertyName == "ALIAS_GLOBAL") { if (status.GetMakefile().IsAlias(name)) { - return StoreResult(infoType, status.GetMakefile(), variable, - target->GetName().c_str()); + if (propertyName == "ALIASED_TARGET") { + + return StoreResult(infoType, status.GetMakefile(), variable, + target->GetName().c_str()); + } + if (propertyName == "ALIAS_GLOBAL") { + return StoreResult( + infoType, status.GetMakefile(), variable, + status.GetMakefile().GetGlobalGenerator()->IsAlias(name) + ? "TRUE" + : "FALSE"); + } } return StoreResult(infoType, status.GetMakefile(), variable, nullptr); } |