[cmake-developers] Multiple dependent install(EXPORT) sets

Brad King brad.king at kitware.com
Tue Nov 22 10:16:20 EST 2011


On 11/22/2011 10:03 AM, Stephen Kelly wrote:
> Brad King wrote:
>> We will have to require that the install(EXPORT)
>> commands be invoked in dependency order (ex. A before B).  That way when
>> the command installing ExportB is writing library B's dependency on A, it
>> can transform the name using the options that had been given to the
>> install command for ExportA, such as its NAMESPACE.

This is required because ExportB will create an imported target for library B
and that imported target will list its dependency on an imported target for
library A.  What is that imported target called?  Where is it defined?  Only
ExportA knows, and then only after its install(EXPORT) has been called.

>> Furthermore, the targets file
>> generated for ExportB will need to include() the file generated for
>> ExportA using the DESTINATION given to the latter to make its targets
>> available.
>
> And its FILE presumably, but why? This ties in to the question of whether
> find_package(B) should find the dependencies of B:

We could leave this part out and leave it up to the Config.cmake file
author to ensure ExportA's targets file is loaded when ExportB's targets
file is loaded.

-Brad



More information about the cmake-developers mailing list