diff options
author | Brad King <brad.king@kitware.com> | 2008-03-02 19:35:23 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-03-02 19:35:23 (GMT) |
commit | d732de4a8a189699135e67f8bad66757bdcf188f (patch) | |
tree | a18672b2681d61fd62d3be37cb9166ab3fe50290 /Source/cmInstallTargetGenerator.cxx | |
parent | 16a415dd0c81a4a11cf6fa78755ce636e5ac3ab9 (diff) | |
download | CMake-d732de4a8a189699135e67f8bad66757bdcf188f.zip CMake-d732de4a8a189699135e67f8bad66757bdcf188f.tar.gz CMake-d732de4a8a189699135e67f8bad66757bdcf188f.tar.bz2 |
ENH: Cleanup builtin chrpath support
- Move computation of extended build-tree rpath
to cmComputeLinkInformation
- Only enable the extended build-tree rpath if
the target will be installed
- Generalize the interface of file(CHRPATH)
- When changing the rpath on installation only
replace the part generated by CMake because
the native tools (ex SunCC on Linux) might have
added their own part to the rpath
Diffstat (limited to 'Source/cmInstallTargetGenerator.cxx')
-rw-r--r-- | Source/cmInstallTargetGenerator.cxx | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index c2d606e..9ecf346 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -552,15 +552,8 @@ cmInstallTargetGenerator ::AddChrpathPatchRule(std::ostream& os, Indent const& indent, const char* config, std::string const& toDestDirPath) { - if(this->ImportLibrary || - !(this->Target->GetType() == cmTarget::SHARED_LIBRARY || - this->Target->GetType() == cmTarget::MODULE_LIBRARY || - this->Target->GetType() == cmTarget::EXECUTABLE)) - { - return; - } - - if(!this->Target->IsChrpathUsed()) + // Skip the chrpath if the target does not need it. + if(this->ImportLibrary || !this->Target->IsChrpathUsed()) { return; } @@ -573,12 +566,16 @@ cmInstallTargetGenerator return; } + // Construct the original rpath string to be replaced. + std::string oldRpath = cli->GetRPathString(false); + // Get the install RPATH from the link information. std::string newRpath = cli->GetChrpathString(); // Write a rule to run chrpath to set the install-tree RPATH - os << indent - << "FILE(CHRPATH \"" << toDestDirPath << "\" \"" << newRpath << "\")\n"; + os << indent << "FILE(CHRPATH FILE \"" << toDestDirPath << "\"\n" + << indent << " OLD_RPATH \"" << oldRpath << "\"\n" + << indent << " NEW_RPATH \"" << newRpath << "\")\n"; } //---------------------------------------------------------------------------- |