[CMake] RPATH for external library
Pawel Veselov
pawel.veselov at gmail.com
Thu May 18 13:52:04 EDT 2017
>> > If I understand things correctly, pkg-config does not return the
>> > RPATH-arguments necessary to link with. IOW, if used in a GNU
>> > Makefile you would also need to add these by yourself, right? So
>> > your problem is not a cmake-problem.
>> IMHO it's not fair to say - if it's not supported by GNUmake, it
>> shouldn't be supported by CMake.
> That was not my intention to say. But rather I thought that somewhere
> this problem was already solved, as it is not a cmake-only-problem, but
> a general build problem when using pkg-config on libraries which are not
> in default search-pathes.
Agree.
>> In any case, the CMake documentation says that
>> INSTALL_RPATH_USE_LINK_PATH "...will append directories in the linker
>> search path and outside the project to the INSTALL_RPATH...", there
>> is no statement that it only applies to linker search paths that were
>> supplied in a certain way.
> That applies only to libraries, not the linker-flags which have
> been added behind the back of cmake's library-dependency mechanism.
Right, so it's not all search paths. I would advocate for changing the
documentation so it is clear.
>> [skipped]
> This skipped part was trying to point out a solution based on the -l
> and -L arguments returned by pkg-config and some cmake parsing. It
> wouldn't be beautiful, but it'll work.
Agree. I just didn't have any other comment for that.
More information about the CMake
mailing list