[cmake-developers] Package Config files with COMPONENTS
Alexander Neundorf
neundorf at kde.org
Tue Mar 13 15:25:27 EDT 2012
On Tuesday 13 March 2012, Brad King wrote:
> On 3/13/2012 1:12 PM, Alexander Neundorf wrote:
> > Setting CMP0018 to new would mean that the project supports only those
> > component-aware packages which follow that new convention.
>
> Yes, that cannot be a requirement to use
>
> cmake_minimum_required(VERSION 2.8.8)
>
> or whatever version of CMake introduces the policy as that would set
> it to NEW implicitly. We cannot make this a special case because then
> it would simply not be a policy. It introduces a requirement on the
> CMake version-awareness of a project's dependencies instead of just
> the project.
>
> > Some users/developers would prefer if there was a more strict definition
> > of how the COMPONENTS arguments should be handled.
>
> My proposal only requires the small change to CMake already under
> discussion and makes it possible for projects to provide package
> configuration files that handle components in a nice way. It also
> does not preclude the possibility of a future convention. However,
> any "strict definition" of behavior would *force* every project to
> adapt to it even if it doesn't make sense just because it made
> sense for a few *other* projects.
How about this:
* no policy
* new argument find_package( OPTIONAL_COMPONENTS), so we get two sets of
components
* the components are still ignored by find_package() for setting Foo_FOUND
* I add some code to FPHSA so it handled COMPONENTS and REQUIRED_COMPONENTS as
done in my branch (i.e. COMPONENTS are required, OPTIONAL_COMPONENTS not)
* I maybe add something to @PACKAGE_INIT@ to help Config files handle
components as recommended
This way we could recommend to handle components in some way, and make it easy
for developers to follow the recommendation.
Alex
More information about the cmake-developers
mailing list