summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkInformation.cxx
diff options
context:
space:
mode:
authorRuslan Baratov <ruslan_baratov@yahoo.com>2016-09-30 23:30:57 (GMT)
committerBrad King <brad.king@kitware.com>2016-10-03 17:42:27 (GMT)
commitdc6d8066607435a0d4b6338bc53e0b1ac746bd35 (patch)
treebd3368be75c92bc776ba126c984c98e5abd07436 /Source/cmComputeLinkInformation.cxx
parent484dc1e5d85f4f468e27816eab0fccc9c7d6ec11 (diff)
downloadCMake-dc6d8066607435a0d4b6338bc53e0b1ac746bd35.zip
CMake-dc6d8066607435a0d4b6338bc53e0b1ac746bd35.tar.gz
CMake-dc6d8066607435a0d4b6338bc53e0b1ac746bd35.tar.bz2
Add a BUILD_RPATH target property specifying build-tree RPATH entries
Users may need to add custom `RPATH` entries to be able to run binaries from their build tree without setting `LD_LIBRARY_PATH`. Provide a way to do this that does not affect the install-tree `RPATH`.
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r--Source/cmComputeLinkInformation.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index dc8236d..0807ef8 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1710,6 +1710,12 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
const char* install_rpath = this->Target->GetProperty("INSTALL_RPATH");
cmCLI_ExpandListUnique(install_rpath, runtimeDirs, emitted);
}
+ if (use_build_rpath) {
+ // Add directories explicitly specified by user
+ if (const char* build_rpath = this->Target->GetProperty("BUILD_RPATH")) {
+ cmCLI_ExpandListUnique(build_rpath, runtimeDirs, emitted);
+ }
+ }
if (use_build_rpath || use_link_rpath) {
std::string rootPath = this->Makefile->GetSafeDefinition("CMAKE_SYSROOT");
const char* stagePath =