Created by: HeapRaid
By using rpath on Linux/BSD we bake the library search path right into the ELF binaries. This relieves the user from the need to set the LD_LIBRARY_PATH
environment variable, which is often overlooked when running from the build tree.
The rpath used for the build tree is different than the path used for the installation, in the build tree we use $ORIGIN
which will add the executable folder to the search path reflecting the behavior on Windows. This means the build tree is moveable and you could simply copy it to the $fs_root$/bin
folder if you'd like to keep the same file structure as the original game. By also restoring the ability to use the fs ltx from the working directory it becomes possible to run OpenXRay in the same way you would on Windows.
When running make install
the rpath is automatically rewritten by CMake to installation prefix so that the libraries can be found regardless of the installation prefix. This is the first step towards allowing OpenXRay to be installed to any prefix including /opt
.