The product is a full embedded Linux operating system. I am trying to add a module to a layer provided by a component provider. For development I am using VS-Code on Ubuntu 18.04. The project is in /home/me/develop/source/ProductX/src/modules/companyGlue and the test directory is underneath it.
I can build a test program but when I run it I get:
/home/me/develop/source/ProductX/.build-pc/src/modules/companyGlue/test/glue_test: error while loading shared libraries: libjson-sax.so: cannot open shared object file: No such file or directory
[1] + Done “/usr/bin/gdb” --interpreter=mi --tty=${DbgTerm} 0<“/tmp/Microsoft-MIEngine-In-xdvmrrfm.on5” 1>“/tmp/Microsoft-MIEngine-Out-2pc4z9vb.qyg”
src/external-pc-only/json-sax/CMakeLists.txt contains
add_library(json-sax SHARED ${json-sax_SOURCES})
install(TARGETS json-sax DESTINATION ${CMAKE_INSTALL_LIBDIR})
After building, .build-pc/src/external-pc-only/json-sax contains:
libjson-sax.so
The project result, libnsdk_companyglue.so, contains the full path /home/me/…/json-sax.
Is there anything I can do to CMakeLists.txt or test/CMakeLists.txt to help glue_test find the json-sax library?