summaryrefslogtreecommitdiffstats
path: root/Help/prop_tgt
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2018-10-07 19:58:28 (GMT)
committerBrad King <brad.king@kitware.com>2018-10-26 13:25:51 (GMT)
commit6114d85a7db0571bfade96a710f34a01bb2037c8 (patch)
tree6ce358b1f2cab1fbe0716a53546663e584565b77 /Help/prop_tgt
parentbba42bb91e25a35791e71461858403360192778b (diff)
downloadCMake-6114d85a7db0571bfade96a710f34a01bb2037c8.zip
CMake-6114d85a7db0571bfade96a710f34a01bb2037c8.tar.gz
CMake-6114d85a7db0571bfade96a710f34a01bb2037c8.tar.bz2
RPATH: Add option for using $ORIGIN in build tree
This makes binaries independent of the build directory by not embedding the build directory via RPATH. The tests are partially based on the existing RuntimePath test, but with the check moved into a POST_BUILD command such that it can be skipped when the platform lacks support. Fixes: #18413
Diffstat (limited to 'Help/prop_tgt')
-rw-r--r--Help/prop_tgt/BUILD_RPATH_USE_ORIGIN.rst24
1 files changed, 24 insertions, 0 deletions
diff --git a/Help/prop_tgt/BUILD_RPATH_USE_ORIGIN.rst b/Help/prop_tgt/BUILD_RPATH_USE_ORIGIN.rst
new file mode 100644
index 0000000..511de7a
--- /dev/null
+++ b/Help/prop_tgt/BUILD_RPATH_USE_ORIGIN.rst
@@ -0,0 +1,24 @@
+BUILD_RPATH_USE_ORIGIN
+----------------------
+
+Whether to use relative paths for the build ``RPATH``.
+
+This property is initialized by the value of the variable
+:variable:`CMAKE_BUILD_RPATH_USE_ORIGIN`.
+
+On platforms that support runtime paths (``RPATH``) with the
+``$ORIGIN`` token, setting this property to ``TRUE`` enables relative
+paths in the build ``RPATH`` for executables that point to shared
+libraries in the same build tree.
+
+Normally the build ``RPATH`` of an executable contains absolute paths
+to the directory of shared libraries. Directories contained within the
+build tree can be made relative to enable relocatable builds and to
+help achieving reproducible builds by omitting the build directory
+from the build environment.
+
+This property has no effect on platforms that do not support the
+``$ORIGIN`` token in ``RPATH``, or when the :variable:`CMAKE_SKIP_RPATH`
+variable is set. The runtime path set through the
+:prop_tgt:`BUILD_RPATH` target property is also unaffected by this
+property.