[cmake-developers] Target usage requirements and conventions

Alexander Neundorf neundorf at kde.org
Wed May 2 14:02:34 EDT 2012


On Wednesday 02 May 2012, David Cole wrote:
> On Wed, May 2, 2012 at 1:18 PM, Alexander Neundorf <neundorf at kde.org> wrote:
> > On Wednesday 02 May 2012, Stephen Kelly wrote:
...
> >> I also think the 'Foo' would be redundant. It should be this to avoid
> >> mistakes:
> >> 
> >> cmake_package(LIBRARIES ${THE_FOO_LIBRARIES})
> >> 
> >> CMake already knows the name of the package, right?
> > 
> > Isn't this getting a bit too much of new concepts ?
> > I mean, the semantics of target_use_package() with imported or in-project
> > targets are quite clear.
> > Isn't everything else not maybe only added complexity for little benefit
> > ?
> > 
> > Alex
> > --
> 
> I agree with Alex here -- let's start simple and add from there.
> target_use_package should make a target use a package. To me, that
> means starting with the basics:
> 
> - automatically add all the right include directories
> - automatically add any required definitions
> - automatically add any required compiler flags
> - automatically link to the right libraries
> - do so recursively for any additional packages that the package itself
> uses 
> - avoid cycles when recursing
> - detect incompatibilities and inconsistencies and warn about them
> early if possible

When you say "package" here, do you mean package as in find_package(), or do 
you mean (typically) an imported target ?

Alex



More information about the cmake-developers mailing list