diff options
author | Brad King <brad.king@kitware.com> | 2019-07-31 19:17:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-07-31 23:32:55 (GMT) |
commit | d70a0f8681919713940d254f9e23141f69f68c31 (patch) | |
tree | 52ece17592afe59331a49ffd887998d6f9124d49 /Source/cmFileAPICodemodel.cxx | |
parent | f43a7d76c737c5bb9b903a2b1be5186c081ec21e (diff) | |
download | CMake-d70a0f8681919713940d254f9e23141f69f68c31.zip CMake-d70a0f8681919713940d254f9e23141f69f68c31.tar.gz CMake-d70a0f8681919713940d254f9e23141f69f68c31.tar.bz2 |
fileapi: Fix codemodel target install destination for cross-dir rules
Since commit e89ad0f94e (install: Allow installing targets created in
another directory, 2018-06-18, v3.13.0-rc1~407^2) we support calling
`install(TARGETS)` for targets created in another directory. However,
install generators are associated with the directory in which the call
to `install()` appears. This may not be the same directory in which the
target is defined. Record in each target the list of install generators
it has.
Fixes: #19546
Diffstat (limited to 'Source/cmFileAPICodemodel.cxx')
-rw-r--r-- | Source/cmFileAPICodemodel.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx index 0fb166a..6025025 100644 --- a/Source/cmFileAPICodemodel.cxx +++ b/Source/cmFileAPICodemodel.cxx @@ -1025,12 +1025,9 @@ Json::Value Target::DumpInstallPrefix() Json::Value Target::DumpInstallDestinations() { Json::Value destinations = Json::arrayValue; - auto installGens = this->GT->Makefile->GetInstallGenerators(); - for (auto iGen : installGens) { - auto itGen = dynamic_cast<cmInstallTargetGenerator*>(iGen); - if (itGen != nullptr && itGen->GetTarget() == this->GT) { - destinations.append(this->DumpInstallDestination(itGen)); - } + auto installGens = this->GT->Target->GetInstallGenerators(); + for (auto itGen : installGens) { + destinations.append(this->DumpInstallDestination(itGen)); } return destinations; } |