[CMake] linked dependencies in exported cmake package

Sergei Nikulov sergey.nikulov at gmail.com
Tue Dec 4 02:44:09 EST 2018


вт, 4 дек. 2018 г. в 10:13, Stéphane Ancelot <sancelot at numalliance.com>:
>
> 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

> 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



-- 
Best Regards,
Sergei Nikulov


More information about the CMake mailing list