On Tue, 16 May 2017 11:50:47 -0700
Pawel Veselov <pawel.vese...@gmail.com> wrote:

> >> 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})  
> 
> That doesn't really play well with FindPkgConfig then. AFAIK, there is
> no way to ask pkg-config to dish out full libraries paths, one would
> have to sift through all -l and -L and figure them out...

Could you switch from pkg-config to find_library() ?

I was once in a situation where I could have used pkg-config with a
custom path to have pkg-config look for the .pc-file. I then switched to
find_library with the custom-path slightly adapted and it worked at
least as good as with pkg-config, if not better. For my case.

regards,
--
Patrick. 
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to