[cmake-developers] A policy for Policies
Stephen Kelly
steveire at gmail.com
Sat Jun 6 06:36:53 EDT 2015
Hi,
The documentation notes that Policies are not feature toggles:
http://www.cmake.org/cmake/help/git-master/manual/cmake-policies.7.html
However, the reality is that Policies *are* feature toggles because they are
so long-lived. Users have no expectation that Policies will 'stop working',
and happily set them to OLD and encourage others to do the same. I see this
on StackOverflow all the time, and on the users mailing list.
Code for Policies is also often complex. I often encounter Policies which
are ancient and which get in the way of code clean up generally.
We also encountered this with CMP0024 and CMP0026 getting in the way in
2013. The refactoring I'm doing now will encounter those two again. I'd also
prefer to drop CMP0011 rather than deal with its complexity in my current
refactoring. CMP0011 was introduced in 2009.
I propose a policy that a Policy may be changed to REQUIRED_IF_USED in a
release two years following the release which introduced it. Such a change
will then result in an error if code attempts to set it to OLD, and
recommend the user to use an older release or fix the code instead.
Thoughts?
Thanks,
Steve.
More information about the cmake-developers
mailing list