[CMake] Exporting files that are not targets

Rainer Poisel rainer.poisel at gmail.com
Sun Aug 14 02:03:31 EDT 2016


Hello,

I am currently working on a project that exports a static library
target including its dependencies so that it can be used with the
`find_package()' command.

With include files this is quite easy by using the $<BUILD_INTERFACE>
and the $<INSTALL_INTERFACE> generator expressions in combination with
the `installl()' command.

However, with dependent libraries which are not built by my project
things are a bit more complicated because
`target_include_directories()' and `target_link_libraries()' search
differently for their arguments.

Is there a way to add dependent libraries (they are all static) to my
package so that they are automatically found and linked to targets
which use my library target?

Thanks for your thoughts and your help,
  Rainer


More information about the CMake mailing list