[CMake] Exporting imported target

Brad King brad.king at kitware.com
Tue Mar 24 16:06:13 EDT 2009


Andreas Pakulat wrote:
> The easiest way to achieve what you want (having targets of
> projectB+projectC available to projectA) is by having the
> FindProjectB.cmake file simply do a find_package(ProjectC REQUIRED) call
> and then make sure that FindProjectC.cmake (or the ConfigProjectC.cmake)
> load the file containing the export-information from ProjectC. So instead
> of exporting imported target let the original exporting from ProjectC run
> automatically when finding ProjectB.

This is the approach intended.  If ProjectB imports ProjectC from somewhere
then ProjectA can import ProjectC from the same place.  It is up to ProjectB
to tell ProjectA which ProjectC it used.

-Brad



More information about the CMake mailing list