diff options
author | Brad King <brad.king@kitware.com> | 2019-03-08 12:32:40 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-03-08 12:32:48 (GMT) |
commit | c2a3a945a5d57dd6630ec0a51434f6e3bdc0e274 (patch) | |
tree | 403c94efd444e52f08732110ef270da850ba755e /Source | |
parent | b7a861647ec5584e23d3730edddf18ad45a2e465 (diff) | |
parent | 47389c5641b821813f3f236bfbc179f52a2c95d7 (diff) | |
download | CMake-c2a3a945a5d57dd6630ec0a51434f6e3bdc0e274.zip CMake-c2a3a945a5d57dd6630ec0a51434f6e3bdc0e274.tar.gz CMake-c2a3a945a5d57dd6630ec0a51434f6e3bdc0e274.tar.bz2 |
Merge topic 'install-no-imported-global'
47389c5641 install: Do not crash on imported global target
Acked-by: Kitware Robot <kwrobot@kitware.com>
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. |