Issue
I have an Unreal Engine project with some plugins which are symlinked, other plugins which are copied and thus I have to read dynamic libraries from several different places. Since this is supposed to work on different Dev machines, the project itself and the Unreal Engine can always be in different locations. Thus it would be nice to use an environment variable for the project and one for the Unreal Engine to use in the rpaths. Is this possible?
Solution
Is it possible to use environment variables for rpath?
No.
Write a wrapper script that uses LD_LIBRARY_PATH and also LD_PRELOAD to load the libraries that you need. Take inspiration from steam
.
See man ld.so
. It has a nice list what happens and what variables are used.
Answered By - KamilCuk