[CMake] Help with cmake_policy

Alexander Neundorf a.neundorf-work at gmx.net
Wed Feb 25 15:27:22 EST 2009


On Wednesday 25 February 2009, eblotml at free.fr wrote:
> ----- Mail Original -----
> De: "Brad King" <brad.king at kitware.com>
> À: eblotml at free.fr
> Cc: cmake at cmake.org
> Objet: Re: [CMake] Help with cmake_policy
>
> Hi Brad,
>
> First of all, thanks for your help.
>
> >> I've tried to use CMAKE_POLICY (SET CMP0011 OLD), but this breaks CMake
> >> 2.6.2 as it seems CMake does not ignore policies that are not known for
> >> a given version of CMake.
> >
> >However, I suggest trying to set it to NEW if the policy exists.  If the
> > project builds then you're all set and can bump the min version to 2.6.3
> > at any time in the future without breaking anything.  If it doesn't
> > build, then it is better to fix it now and still set the policy to NEW.
>
> Yeah, I understand the rationale, however the problem is that you can't
> tell/guess whether a customer will install the exact same version of CMake
> you've used to build a project. It would be nice if the customer does not
> receive a warning a developer never saw before releasing a project.
>
> I agree that for a minor or major release, a warning - or even an error -
> is a useful information, but it is, IMHO, an issue for a patch release.
> From my perspective, it would be nice that the customer can rebuild the
> project *without* warnings, and that CMake X.Y.n builds the project the
> same way as CMake X.Y.m used to (n>m)

Well, the cmake patch releases are actually minor releases, a cmake minor 
release it a quite big release, see the differences between 2.4 and 2.6.
1.x is long long ago, not sure if there are plans for a 3.0.

> The customer may not need to know about CMake internals, and get weird
> warning messages. 

I'd also like to have them somewhat less scary looking...

> It seems the only way to do this is to download and try 
> the last release of CMake as soon as it gets available. As a developer, I
> found some of the CMake policies a bit "cryptic" at first sight, and it may
> take quite a while to understand the impact of such a policy change in
> existing - which means time, while the customer can already download,

Yes, the policies are often for handling quite non-obvious corner cases.

Alex


More information about the CMake mailing list