Reputation: 70353
I know the "search path" of an executable or library can be set using the -rpath
linker option. This is useful when dependencies are installed in non-standard locations not normally considered by the object loader, and usually considered superior to setting the LD_LIBRARY_PATH
environment variable.
However, in my specific case, the path is different between integration test machines and production machines (how little sense that makes is, unfortunately, not up for discussion.)
I would really prefer using the same package for both the integration test and the production platform. My idea is to provide an installation script that selects the proper target directory, and then patches the library / executable RPATH to the correct value.
At which point I found that I don't know...
How can a library / executable RPATH be patched to a different value?
I assume there is some command line tool available for that, but I don't know it.
In case it is of importance, I am using a CMake setup to build and create the .tgz package (cpack -G TGZ
). "Real" packages (RPG, DEB) are, unfortunately, not an option.
Upvotes: 0
Views: 417