[CMake] RPATH for external library
Patrick Boettcher
patrick.boettcher at posteo.de
Tue May 16 04:20:59 EDT 2017
On Mon, 15 May 2017 13:32:15 -0700
Pawel Veselov <pawel.veselov at gmail.com> wrote:
> Hello.
>
> I'm trying to make CMake add to the linker RPATH automatically.
> There is a library that is installed in a non-default location.
> I'm discovering the library using PkgConfig (custom
> CMAKE_APPBUNDLE_PATH) and add the library build options to the
> LINK_FLAGS (using set_property).
Instead of setting the LINK_FLAGS to your external library try using
target_link_libraries() with the full path name to the library.
For example this will work as expected, cmake with set an RPATH
to "/path/to":
set(LIB "/path/to/libsomething.so")
target_link_libraries(test1 ${LIB})
HTH,
--
Patrick.
More information about the CMake
mailing list