[cmake-developers] Target usage requirements and conventions

Stephen Kelly steveire at gmail.com
Sat May 5 17:20:18 EDT 2012


Alexander Neundorf wrote:

> On Thursday 03 May 2012, Stephen Kelly wrote:
>> Alexander Neundorf wrote:
> ...
>> > So, I don't see any need for automatically invoking find_package() from
>> > some other command. Calling find_package() is something people should
>> > be used to, it shouldn't be hard for them. Hiding it in some other
>> > commmands IMO would be good maybe for the lazy programmers, but not for
>> > maintainability. E.g. you have start deciding/explaining when to use
>> > find_package() and when not.
>> 
>> Long term it's easy: You should never use find_package except for cases
>> where the package is unconventional and target_use_package doesn't work.
> 
> This is really the first time that I hear that deprecating find_package()
> is the long term goal.
> 
> Why should this be a goal ?

If target_use_package exists, works, is superior, finds the package it 
depends on (when FIND_PACKAGE is specified), and if most Find modules and 
Config files adhere to the conventions and expect target_use_package to be 
used with the stuff they EXPORT or create a Find module for, then 
find_package calls would naturally be used less and not be needed.

Note that that depends on whether target_use_package should find packages or 
not, which is still under discussion. You think it shouldn't, in which case 
find_package would always be used and I think it should, in which case 
find_package wouldn't be necessary.

So in my mind, it's not so much a goal as an expected consequence (if 
target_use_package finds its argument).

Thanks,

Steve.





More information about the cmake-developers mailing list