Deduce cmake_minimum_required from the features I use

Throughout the documentation, the minimum required CMake version is given. When I create or modify a CMake script, I often forget about the minimum version requirement. Is there a static analysis tool that checks the CMake code and warns if the cmake_minimum_required version declared is not recent enough for the features I use? And conversely, if the required version in cmake_minimum_required is unnecessarily recent?