[cmake-developers] cmake --find-package (was: Roadmap to CMake 3.0)

Stephen Kelly steveire at gmail.com
Thu Oct 17 17:15:03 EDT 2013


Brad King wrote:

> On 10/17/2013 04:58 PM, Alexander Neundorf wrote:
>> Yes, that was the idea, but I can't rely anymore on a Foo_LIBRARIES
>> variable (or a slight variation) being set after a successful
>> find_package(Foo):
>> http://lists.kde.org/?l=kde-core-devel&m=138198795723680&w=2 I.e. in the
>> future there will be Find-modules which typically export one of
>> (Foo|FOO)_(LIBRARIES|LIBRARY), some Config.cmake files which do that too,
>> and a big number, probably majority, of Config.cmake files, which do not
>> export such variables.
>> 
>> The only chance I see would be to simply collect all library targets and
>> return what they provide, but this doesn't feel good. I would have much
>> prefered using a clear interface like the Foo_LIBRARIES variable.
> 
> Perhaps we need to establish a convention for find modules and package
> configuration files to interact with --find-package mode.  I have no
> thoughts on the specifics of how that would work though.

A new, similar --find-target mode or similar may be more appropriate:

 cmake --find-target --package Qt5Widgets --target Qt5::Widgets ...

 # KF5Config exports 3 independent targets:
 cmake --find-target --package KF5Config --target KF5::ConfigCore ...
 cmake --find-target --package KF5Config --target KF5::ConfigGui ...
 cmake --find-target --package KF5Config --target KF5::ConfigWidgets ...

Thanks,

Steve.





More information about the cmake-developers mailing list