mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-18 13:10:17 -06:00
cmInstallTargetGenerator: Escape generated OLD_RPATH argument
On some platforms, e.g. most ELF-based ones, RPATHs may contain keywords that match CMake's variable syntax. To prevent them from being falsely substituted when running the cmake_install.cmake script CMake syntax needs to be escaped.
This commit is contained in:
@@ -750,13 +750,14 @@ void cmInstallTargetGenerator::AddChrpathPatchRule(
|
||||
return;
|
||||
}
|
||||
|
||||
// Escape any CMake syntax in the install RPATH.
|
||||
// Escape any CMake syntax in the RPATHs.
|
||||
std::string escapedOldRpath = cmOutputConverter::EscapeForCMake(oldRpath);
|
||||
std::string escapedNewRpath = cmOutputConverter::EscapeForCMake(newRpath);
|
||||
|
||||
// Write a rule to run chrpath to set the install-tree RPATH
|
||||
os << indent << "file(RPATH_CHANGE\n"
|
||||
<< indent << " FILE \"" << toDestDirPath << "\"\n"
|
||||
<< indent << " OLD_RPATH \"" << oldRpath << "\"\n";
|
||||
<< indent << " OLD_RPATH " << escapedOldRpath << "\n";
|
||||
|
||||
// CMP0095: ``RPATH`` entries are properly escaped in the intermediary
|
||||
// CMake install script.
|
||||
|
||||
Reference in New Issue
Block a user