File tree 1 file changed +17
-1
lines changed
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,23 @@ option(RETDEC_TESTS "Build tests." OFF)
13
13
14
14
set (CMAKE_CXX_STANDARD 14)
15
15
16
- set (CMAKE_INSTALL_RPATH "$ORIGIN/../lib" )
16
+ # On Linux and macOS, set RPATH relative to the origin of the installed
17
+ # executables (i.e. relative to the bin directory). This allows us to move the
18
+ # installation directory into a different location after installation, which is
19
+ # useful e.g. when the installation is performed on one machine but we want to
20
+ # run the executables on a different machine.
21
+ #
22
+ # On Windows, there is no need to set anything as DLLs are installed into the
23
+ # bin directory, where they are automatically picked up by executables.
24
+ #
25
+ # For more details, see
26
+ # - https://github.com/avast-tl/retdec/issues/77
27
+ # - https://cmake.org/Wiki/CMake_RPATH_handling
28
+ if (APPLE )
29
+ set (CMAKE_INSTALL_RPATH "@executable_path/../lib" )
30
+ elseif (UNIX )
31
+ set (CMAKE_INSTALL_RPATH "$ORIGIN/../lib" )
32
+ endif ()
17
33
18
34
# Build all external projects in the same directory that is directly inside the
19
35
# build directory. This reduces path lengths, which is important on Windows as
You can’t perform that action at this time.
0 commit comments