[CMake] find_package and get_target_property

Saad Khattak saadrustam at gmail.com
Fri Apr 13 08:49:47 EDT 2018


Thanks Marc. I assume you mean the library does not export its targets
properly? Something like this:

# https://cmake.org/Wiki/CMake/Tutorials/Exporting_and_Importing_Targets
install(TARGETS generator DESTINATION lib/myproj/generators EXPORT
myproj-targets)
install(EXPORT myproj-targets DESTINATION lib/myproj)

On Fri, Apr 13, 2018 at 3:05 AM CHEVRIER, Marc <marc.chevrier at sap.com>
wrote:

> The creation of “imported” target is the responsibility of the package.
> May be the package “LibA” does not create a such target.
>
> In this case, you have to rely on variables (like LibA_LIBRARIES and so
> on…). The documentation of the package, if any, generally describe how to
> use the package.
>
>
>
>
>
> *From: *CMake <cmake-bounces at cmake.org> on behalf of Saad Khattak <
> saadrustam at gmail.com>
> *Date: *Friday 13 April 2018 at 05:29
> *To: *Cmake Mailing List <cmake at cmake.org>
> *Subject: *[CMake] find_package and get_target_property
>
>
>
> Hi,
>
>
>
> I am successfully able to find a package using find_package(LibA) but I
> cannot do a get_target_property on the package as I get the error:
>
>
>
> get_target_property() called with non-existent target "LibA"
>
>
>
> How do I go about the target properties for a package?
>
>
>
> - Saad
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180413/3457b197/attachment.html>


More information about the CMake mailing list