[CMake] Help with cmake_policy

eblotml at free.fr eblotml at free.fr
Wed Feb 25 09:33:36 EST 2009


----- 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)

The customer may not need to know about CMake internals, and get weird warning messages. 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, upgrade his development environment, get warnings and ask for support.

I may have missed something important, though ;-)

Anyway, thanks a lot for your help, I'm gonna fix our projects.

Cheers,
Manu


More information about the CMake mailing list