[cmake-developers] Package Config files with COMPONENTS

Alexander Neundorf neundorf at kde.org
Tue Mar 13 13:12:45 EDT 2012


On Tuesday 13 March 2012, Brad King wrote:
> On 3/10/2012 1:15 PM, Alexander Neundorf wrote:
> > I pushed a branch ImprovedCOMPONENTSSupportInFindPackage to stage.
> > 
> > It is not finished (documentation and an updated fphsa() are missing at
> > least), but you may want to have a look at it.
> > 
> > It adds
> > * OPTIONAL_COMPONENTS
> 
> Will this interact well when a Find module forwards with NO_MODULE?
> 
> > * CMP0018: if a listed component is not found, Foo_FOUND is set to false
> > in Config mode
> 
> I do not think CMP0018 can work quite as we need.  If a project sets
> the behavior to NEW how does it know the package configuration file
> it finds will be aware that it needs to set the Foo_<component>_FOUND
> variables?  That is not something that cmake_minimum_required(VERSION)
> can know when it sets the policy to NEW.
> 
> We don't know how packages out there interpret components.  For some
> it may just be a list which can always be satisfied.  Others may
> already provide a value equivalent to Foo_<component>_FOUND but with
> a different name that makes more sense for their use case.

Setting CMP0018 to new would mean that the project supports only those 
component-aware packages which follow that new convention.

Alex



More information about the cmake-developers mailing list