It seems that this question was asked very often, but none of the solutions seems to be applicable in my case.
I am in a CMake / Linux environment and must run the executable binary at the build stage ( protocin particular).
This binary needs a library but is not installed (and cannot be) in standard directories, such as /usr, therefore the library cannot be found.
Unfortunately, I cannot manipulate the call protocbecause it is built into a third-party script.
Now I can install it LD_LIBRARY_PATHin front of each makeor install it on a system scale, but this is very inconvenient, especially when it comes to IDEs in which assembly or distributed build scripts with continuous build environments occur.
I tried to install LD_LIBRARY_PATHthrough
set(ENV{LD_LIBRARY_PATH} "/path/to/library/dir")
but this does not affect the build step.
So my question is: can I set the library search path in CMake, which is used during build?
frans source
share