[cmake-developers] Exporting dependent library targets in multiple export sets

Alexander Neundorf neundorf at kde.org
Tue Sep 11 15:47:17 EDT 2012


Hi Yury,

On Thursday 23 August 2012, Yury G. Kudryashov wrote:
> Hi!
> 
> 2012/8/23 Daniel Pfeifer <daniel at pfeifer-mail.de>:
> > 2012/8/22 Yury G. Kudryashov <urkud.urkud at gmail.com>:
> >>> Any "latest install" strategy is bound to generate subtle problems.
> >>> 
> >>> Dependencies among export sets should be explicit:
> >>>   install(EXPORT MyExport DEPENDS YourExport)
> >> 
> >> How should I choose between different
> >> install(EXPORT YourExport)
> >> commands?
> > 
> > What about:
> >   install(EXPORT MyExport DEPENDS YourPackage1 YourPackage2)
> > 
> > ? That could create:
> >   if(NOT __MyExport_include_guard)
> >   
> >     set(__MyExport_included TRUE)
> >     find_package(YourPackage1)
> >     find_package(YourPackage2)
> >   
> >   endif()
> > 
> > before declaring the imported targets.
> > That way, we get the package dependencies resolved transitively.
> 
> This does not solve the problem of resolving namespaces.
> 
> What do you think about the following algorithm:
> 
> 1. Export set lookup
> 1a. Look in the current export set.
> 1b. If failed, look in the export sets listed in DEPENDS parameter.
> 1c. If failed, look if the target belongs to a unique export set.
> 1d. If failed, produce an error message.
> 
> 2. Installation of an export set lookup.
> 2a. For the current export set, use the current installation.
> 2b. For dependencies, if an export set was not installed or was
> installed more than once, fail; otherwise, use the unique
> installation.
> 
> Some questions:
> 1. What should we do in the APPEND mode?
> 2. Should we include(/path/to/dependency)? Or find_package() as
> suggested by Daniel?
> 2a. If yes, using relative or absolute path?


will you be able to work on this for the 2.8.10 release ?
This would be great.
If not, no problem, but please let us know, so either Stephen or me can give 
it a try.

Thanks :-)
Alex



More information about the cmake-developers mailing list