summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallTargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmInstallTargetGenerator.cxx')
-rw-r--r--Source/cmInstallTargetGenerator.cxx19
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";
}
//----------------------------------------------------------------------------