[cmake-developers] A policy for Policies

Brad King brad.king at kitware.com
Wed Jun 10 10:28:22 EDT 2015


On 06/10/2015 01:41 AM, Domen Vrankar wrote:
> So that's why my newly added test broke with CMP0011 error :) I didn't
> even know that I was using this policy with old functionality... Can I
> somehow force treating of all policies as errors to spot such cases
> for e.g. in tests?

See my response to the GP for a side note about policies in tests.

> Should cmake_minimum_required also be used in CMake scripts (added
> with -P argument to CMake command) not just CMakeLists.txt?

Yes.

> And do we really still need version 2.6 as default (we could bump this
> version to where current policies are still treated as warnings not
> errors)?

To which default do you refer?  Where in our code is it set?
Likely we cannot update it because it could change behavior
of existing scripts with no transition warning ever given.

> I'd also be glad if missing cmake_minimum_required in root CMake
> list/script would be treated as error and not as warning since you can
> get old policies in by accident.

Yes, we should consider enforcing CMP0000 in script mode too
or perhaps add a separate policy for it.

-Brad



More information about the cmake-developers mailing list