[cmake-developers] Target usage requirements and conventions

David Cole david.cole at kitware.com
Wed May 2 14:27:32 EDT 2012


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.



More information about the cmake-developers mailing list