CMake policy versions older than 3.10 are deprecated
Deprecated as of 2024-11-06. Replacement: cmake_minimum_required(VERSION 3.10) or newer, or VERSION <min>…<max> with <max> at least 3.10. Source: CMake 3.31 release notes (compatibility older than 3.10 deprecated).
Check a version:
evergreen check pkg:generic/cmake
CMake 3.31 deprecated compatibility with policy versions older than 3.10. A cmake_minimum_required(VERSION) or cmake_policy(VERSION) call that does not set the policy version to at least 3.10 (optionally via …<policy_max>) produces a deprecation warning on CMake 3.31 and newer. CMake 3.31.0 was published on 2024-11-06. Versions older than 3.5 are covered by the removal rule instead.
Look up another package or runtime · <form action="../lookup.html" method="get" role="search"> </form>
| Status | Deprecated |
| Severity | medium |
| Ecosystem | cpp |
| Component | pkg:generic/cmake |
| Affected versions | vers:semver/>=3.5.0\|<3.10.0 |
| Date from the source | 2024-11-06 |
| Replacement | cmake_minimum_required(VERSION 3.10) or newer, or VERSION <min>…<max> with <max> at least 3.10 |
| Evidence last seen | 2026-10-19 |
| Reviewed | 2026-10-19 by arminazimi |
| Review due | 2027-04-17 (180 days after the last review) |
| Rule ID | cpp.cmake.policy-below-3.10.deprecated |
Sources
- CMake 3.31 release notes (compatibility older than 3.10 deprecated) (accessed 2026-10-19)
- cmake_minimum_required (Changed in 3.31) (accessed 2026-10-19)
- CMake 3.31.0 GitHub release (accessed 2026-10-19)
Migration
Constraints
- Raising the policy version can change NEW policy behavior; read the policies introduced between the old and new floor before committing.
Steps
- Raise the reported cmake_minimum_required policy version. Change the reported cmake_minimum_required(VERSION …) so the effective policy version is at least 3.10 (for example VERSION 3.16, or VERSION 3.5…3.16).
Verification
cmake -S . -B build -Wdev: Configure with developer warnings enabled and confirm the policy-floor deprecation is gone.
Detected by
The cpp detector. See Detectors and Compatibility.
Related
Other versions of this product
Same ecosystem
- The Visual Studio 12 2013 generator is removed
- The CMakeFindFrameworks module is deprecated
- The FindGDAL module is deprecated
Data
This page is generated from registry/cpp.json, rule cpp.cmake.policy-below-3.10.deprecated, in the ebb.registry.v2 format (how rules are written). A CLE (ECMA-428) export is not published yet. The same facts are embedded in this page as schema.org structured data.
Last updated