[CMake] linking to .so's

Steven Van Ingelgem steven at vaningelgem.be
Wed May 21 08:45:45 EDT 2008


Hi,


I have a question about how to link (via CMake) to specific .so's.

I know I need to use target_link_libraries. But what happens then is
that the so is linked against the directory where it's in.
Is there a possibility (i know rpath does exist, but I don't know
exactly how to use it) to have the .so's loaded from the local
directory before it starts looking in the default library directories?

An example:
MyPlugin.so ==>
target_link_libraries(MyPlugin "/src/MyPlugin/libbz2.so").

When I deploy this on a target system, the target system cannot use
the libbz2 unless it's in exact that directory... What I would like is
that it's in the directory of MyPlugin and also loaded from there...


Thanks!


More information about the CMake mailing list