summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-03-07 14:17:21 (GMT)
committerBrad King <brad.king@kitware.com>2019-03-07 14:17:21 (GMT)
commitc042c998d01a75af4299c0b83341ccbd116566e8 (patch)
treee78256f7fa520ab555d1fbde1c208484042f849e /Source
parent898d21ebe65efeb5787046bd67768d51d602615e (diff)
parent47389c5641b821813f3f236bfbc179f52a2c95d7 (diff)
downloadCMake-c042c998d01a75af4299c0b83341ccbd116566e8.zip
CMake-c042c998d01a75af4299c0b83341ccbd116566e8.tar.gz
CMake-c042c998d01a75af4299c0b83341ccbd116566e8.tar.bz2
Merge branch 'install-no-imported-global' into release-3.14
Merge-request: !3071
Diffstat (limited to 'Source')
-rw-r--r--Source/cmInstallCommand.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 8ef6441..20d1a31 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -402,7 +402,11 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
cmTarget* target = this->Makefile->FindLocalNonAliasTarget(tgt);
if (!target) {
// If no local target has been found, find it in the global scope.
- target = this->Makefile->GetGlobalGenerator()->FindTarget(tgt, true);
+ cmTarget* const global_target =
+ this->Makefile->GetGlobalGenerator()->FindTarget(tgt, true);
+ if (global_target && !global_target->IsImported()) {
+ target = global_target;
+ }
}
if (target) {
// Found the target. Check its type.