summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallTargetGenerator.cxx
diff options
context:
space:
mode:
authorDennis Klein <d.klein@gsi.de>2019-05-31 14:43:24 (GMT)
committerDennis Klein <d.klein@gsi.de>2019-06-13 14:41:11 (GMT)
commit749ce48eb5b2876b347115a857839fdf9c24a221 (patch)
treedf441fad2f151860541b8ccf693f3c2a969c7727 /Source/cmInstallTargetGenerator.cxx
parent9e84c7c5e8e243624858692bddb6f13485f46774 (diff)
downloadCMake-749ce48eb5b2876b347115a857839fdf9c24a221.zip
CMake-749ce48eb5b2876b347115a857839fdf9c24a221.tar.gz
CMake-749ce48eb5b2876b347115a857839fdf9c24a221.tar.bz2
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.
Diffstat (limited to 'Source/cmInstallTargetGenerator.cxx')
-rw-r--r--Source/cmInstallTargetGenerator.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 0e2f9c5..0774436 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -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.