diff options
author | Brad King <brad.king@kitware.com> | 2019-03-07 14:17:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-03-07 14:17:21 (GMT) |
commit | c042c998d01a75af4299c0b83341ccbd116566e8 (patch) | |
tree | e78256f7fa520ab555d1fbde1c208484042f849e /Source | |
parent | 898d21ebe65efeb5787046bd67768d51d602615e (diff) | |
parent | 47389c5641b821813f3f236bfbc179f52a2c95d7 (diff) | |
download | CMake-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.cxx | 6 |
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. |