diff options
author | Stephen Kelly <steveire@gmail.com> | 2012-09-15 21:54:01 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2012-09-19 13:30:57 (GMT) |
commit | 4f5384e75c6a00d110d3fa3f555a3f6a4f31bb46 (patch) | |
tree | 57a48f6e311086bd39520389d700bbb70d4b39d6 /Source/cmInstallTargetGenerator.cxx | |
parent | 987e12e2f962b6e9ed9f15f8ff486512911b744e (diff) | |
download | CMake-4f5384e75c6a00d110d3fa3f555a3f6a4f31bb46.zip CMake-4f5384e75c6a00d110d3fa3f555a3f6a4f31bb46.tar.gz CMake-4f5384e75c6a00d110d3fa3f555a3f6a4f31bb46.tar.bz2 |
Move GetLinkInformation to cmGeneratorTarget
Diffstat (limited to 'Source/cmInstallTargetGenerator.cxx')
-rw-r--r-- | Source/cmInstallTargetGenerator.cxx | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 5f9b658..347ad3e 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -16,6 +16,7 @@ #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmake.h" +#include "cmGeneratorTarget.h" #include <assert.h> @@ -26,7 +27,8 @@ cmInstallTargetGenerator std::vector<std::string> const& configurations, const char* component, bool optional): cmInstallGenerator(dest, configurations, component), Target(&t), - ImportLibrary(implib), FilePermissions(file_permissions), Optional(optional) + ImportLibrary(implib), FilePermissions(file_permissions), + Optional(optional), GeneratorTarget(0) { this->ActionsPerConfig = true; this->NamelinkMode = NamelinkModeNone; @@ -484,6 +486,17 @@ void cmInstallTargetGenerator::PostReplacementTweaks(std::ostream& os, this->AddStripRule(os, indent, file); } +void cmInstallTargetGenerator::CreateGeneratorTarget() +{ + if (!this->GeneratorTarget) + { + this->GeneratorTarget = this->Target->GetMakefile() + ->GetLocalGenerator() + ->GetGlobalGenerator() + ->GetGeneratorTarget(this->Target); + } +} + //---------------------------------------------------------------------------- void cmInstallTargetGenerator @@ -507,10 +520,13 @@ cmInstallTargetGenerator return; } + this->CreateGeneratorTarget(); + // Build a map of build-tree install_name to install-tree install_name for // shared libraries linked to this target. std::map<cmStdString, cmStdString> install_name_remap; - if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config)) + if(cmComputeLinkInformation* cli = + this->GeneratorTarget->GetLinkInformation(config)) { std::set<cmTarget*> const& sharedLibs = cli->GetSharedLibrariesLinked(); for(std::set<cmTarget*>::const_iterator j = sharedLibs.begin(); @@ -608,9 +624,12 @@ cmInstallTargetGenerator return; } + this->CreateGeneratorTarget(); + // Get the link information for this target. // It can provide the RPATH. - cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config); + cmComputeLinkInformation* cli = + this->GeneratorTarget->GetLinkInformation(config); if(!cli) { return; @@ -639,9 +658,12 @@ cmInstallTargetGenerator return; } + this->CreateGeneratorTarget(); + // Get the link information for this target. // It can provide the RPATH. - cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config); + cmComputeLinkInformation* cli = + this->GeneratorTarget->GetLinkInformation(config); if(!cli) { return; |