How to specify library dir for imported interface?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to specify library dir for imported interface?

Francis Giraldeau
> However, it seems no property exists to actually specify the library dir
> of imported target, nor the linker flags to pass when using the
> imported target.
> What would be the best way to specify the library dir for an imported
> library?

My workarround at the moment is to add a global link_directories(). It is not clean, as it lacks the transitivity for library users, but at least it works.

Cheers,

Francis
--
Francis Giraldeau

--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: How to specify library dir for imported interface?

Marc CHEVRIER
Next version of CMake (3.13) will supports properties LINK_OPTIONS as well as INTERFACE_LINK_OPTIONS.

Le mer. 4 juil. 2018 à 16:02, Francis Giraldeau <[hidden email]> a écrit :
> However, it seems no property exists to actually specify the library dir
> of imported target, nor the linker flags to pass when using the
> imported target.
> What would be the best way to specify the library dir for an imported
> library?

My workarround at the moment is to add a global link_directories(). It is not clean, as it lacks the transitivity for library users, but at least it works.

Cheers,

Francis
--
Francis Giraldeau
--

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:
https://cmake.org/mailman/listinfo/cmake

--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: How to specify library dir for imported interface?

Francis Giraldeau
Le mer. 4 juil. 2018 à 10:43, Marc CHEVRIER <[hidden email]> a écrit :
Next version of CMake (3.13) will supports properties LINK_OPTIONS as well as INTERFACE_LINK_OPTIONS.

Interesting, will it fix the issue with pkg-config? When installed in a non-standard directory, pkg-config will return the library dir. Here is an example with libsodium:

$ PKG_CONFIG_PATH=/tmp/bidon/lib/pkgconfig pkg-config --libs libsodium
-L/tmp/bidon/lib -lsodium

At first, the property INTERFACE_LINK_DIRECTORIES would make sens. Would there be some drawbacks to specify link directories for imported targets?

Cheers,

Francis
--
Francis Giraldeau

--

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:
https://cmake.org/mailman/listinfo/cmake