> A better Policy lifecycle would be
>
> 1) Three releases after introducing a Policy, we make OLD the same as WARN
>    for it. That is, the only way to not get the warning will be to fix the
>    code or use -Wno-dev.
> 2) After some time in years (depending on the impact of the Policy), we
>    change it to an unconditional error.
> 3) Remove the code implementing the OLD behavior in a following release.

+1

> That is because currently Policies *are* feature switches. The answer to
> that is not more warnings, as Alex told us, but error conditions. There
> needs to be credibility to any documentation claiming that setting a Policy
> to OLD will result in an error some day. Such documentatation will be
> ignored.

I've personally never seen them as feature switches but I agree that
they can be too quickly seen as such.

> I've pushed a branch for testing which updates the policies <= CMP0011 to
> REQUIRED_IF_USED. Those have resulted in warnings by default for 6 years.
> That is a long time to ignore warnings.

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?

Side question:
Should cmake_minimum_required also be used in CMake scripts (added
with -P argument to CMake command) not just CMakeLists.txt?
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)?
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.

Regards,
Domen
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to