[CMake] Help with find module for package w/ components

Zaak Beekman zbeekman at gmail.com
Fri Feb 23 17:27:03 EST 2018


I need some guidance. I am writing a find module for a package that defines
multiple library archives, includes and Fortran module files. I would like
to make a "best practices" and "modern" find module and define a target so
that transitive properties are propagated correctly. I would like to define
two components, the base package itself (multiple library files and Fortran
module files) and then the C interface (additional library file and C
include files).

The biggest point of confusion: Is there a way to define a single target
that can be passed to target_link_libraries() that will cause the
*multiple* (imported) library archives of the base package to linked in?
Can I define it in such a way that it is namespaced like Foo::Foo?

For an optional component, then do I specify an additional target for that
component?

Thanks,
Zaak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180223/627b1058/attachment.html>


More information about the CMake mailing list