cmake_minimum_required: Document deprecated versions
Currently you are getting a deprecation warning, when defining a cmake_minimum_required
with 2.8.11 (since CMake 3.19: !4897 (merged)) or 3.4 (since CMake 3.27: !8192 (merged)) and older. Sadly this is currently not documented in the documentation. Another thing is: Neither in the release nor in the MR that changed the deprecated warning is a reason documented why exactly this version are marked as deprecated (why 3.5 is okay, but 3.4 not?).
The last thing is a bit painful: we are currently getting warnings from 3rd party projects because they have compatibility with e.g. CMake 3.3. With this warning we now don't know if we shouldn't update to CMake 3.27 until all 3rd party libraries are adjusted, because maybe something is broken or we can ignore the warning.
When I first saw the warning with CMake 3.5, I thought that the compatibility with CMake 2.8.12 has now finally been removed (meaning that all policies before CMake 3.0, see here, have been removed), since the warning has been around for a few years and in a few years everything before 3.5 will be removed. However, I have not found any change in CMake 3.27 related to this.
Instead, I only find changes that CMake's own tests now minimally require CMake 3.5. However, I interpret this to mean that the warning "Compatibility with CMake < 3.5 will be removed from a future version of CMake" is actually incorrect. Instead it should say: "Compatibility with CMake < 3.5 is no longer guaranteed and may lead to unexpected results".
So what would be nice?
- The documentation of
cmake_minimum_required
should get a hint which passed version will cause a deprecation warning. - There should be a documentation, how the deprecation cycle of CMake is working.