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
This commit is contained in:
Peter Wu
2018-10-07 21:58:28 +02:00
committed by Brad King
parent bba42bb91e
commit 6114d85a7d
12 changed files with 159 additions and 4 deletions

View File

@@ -0,0 +1,7 @@
CMAKE_BUILD_RPATH_USE_ORIGIN
----------------------------
Whether to use relative paths for the build ``RPATH``.
This is used to initialize the :prop_tgt:`BUILD_RPATH_USE_ORIGIN` target
property for all targets, see that property for more details.