I want to use a library with a C++ project and I need to set the LD_LIBRARY_PATH to get it to compile and execute fine. The code compilation is done using gradle. I am trying to set the LD_LIBRARY_PATH in build.gradle as below but it doesn't seem to work:
task exportLDLibPath() {
exec {
environment 'LD_LIBRARY_PATH', '/path/to/lib'
}
project.check.dependsOn it
}
What am I missing here? I need to path to be set so that the unit tests can run.
After some digging and discussions, found out that the below code does the trick: