I\'ve done this before a couple of times, but somehow I\'m stuck this time. I have an executable \"myapp\" and a own shared library \"mylib\". In my cmakelists I have the follow
Add the path of the directory containing the library to the LD_LIBRARY_PATH environment variable, by appanding a new path:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/the/library/
You can check the library is correctly found with the 'ldd' tool:
lld ./executable
If the library is not stated as "not found" it is OK and your executable will be executed properly.
Add the 'export' command to your bashrc to properly set the LD_LIBRARY_PATH variable after each system reboot, otherwise you will have to execute again the 'export' command.