[cmake-developers] Target usage requirements and conventions
Clinton Stimpson
clinton at elemtech.com
Thu May 3 11:35:44 EDT 2012
On Wednesday, May 02, 2012 12:27:32 pm David Cole wrote:
> On Wed, May 2, 2012 at 2:02 PM, Alexander Neundorf <neundorf at kde.org> wrote:
> > 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
>
> I mean package. If we mean target here, then the new command should be
> named target_use_target.
I like the idea of a target_use_target() that can be used with both imported
and non-imported targets.
The include, defines, etc... can be properties on a target when when
target_use_target() is used, it could extract those properties and apply them
on the using target.
In the long run, I'd prefer that over directory scoped variables to pass
around the information.
--
Clinton Stimpson
Elemental Technologies, Inc
Computational Simulation Software, LLC
www.csimsoft.com
More information about the cmake-developers
mailing list