Discussion:
[CMake] linked dependencies in exported cmake package
Stéphane Ancelot
2018-12-04 07:13:00 UTC
Permalink
Hi,

I made an exported package for a library that needs linking qt5.

find_package() works to find my library , however, I don't know how to
handle the linking of external libs needed by this package.

I suppose that must be managed inside the exported package, by which way ?

Regards,

S.Ancelot
--
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
Sergei Nikulov
2018-12-04 07:44:09 UTC
Permalink
Post by Stéphane Ancelot
Hi,
I made an exported package for a library that needs linking qt5.
find_package() works to find my library , however, I don't know how to
handle the linking of external libs needed by this package.
I suppose that must be managed inside the exported package, by which way ?
I use the following way
set_target_properties(<your exported target> PROPERTIES
INTERFACE_LINK_LIBRARIES <library required to link with your target>)

Ref here https://cmake.org/cmake/help/latest/prop_tgt/INTERFACE_LINK_LIBRARIES.html
Post by Stéphane Ancelot
Regards,
S.Ancelot
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
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
https://cmake.org/mailman/listinfo/cmake
--
Best Regards,
Sergei Nikulov
--
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:
htt
Loading...