[cmake-developers] Package Config files with COMPONENTS

Alexander Neundorf neundorf at kde.org
Tue Mar 13 17:10:35 EDT 2012


On Tuesday 13 March 2012, Brad King wrote:
...
> > The argument parsing in cmFindPackage still has to decide what to do if a
> > component appears multiple times.
> > Error out ?
> > REQUIRED always has priority over OPTIONAL ?
> > Last one wins ?
> 
> I think error is best.  It's better to be explicit so authors do not
> assume ether way.

Ok, I'll work on it in the next days.
Regarding the error: I think (didn't check) right now cmake doesn't complain 
if I list a component multiple times:

find_package(Foo COMPONENTS bar blub bar)

If it doesn't, then I'd say

find_package(Foo COMPONENTS bar blub OPTIONAL_COMPONENTS bar)

maybe also should not lead to an error.

Alex



More information about the cmake-developers mailing list