Skip to content
Evergreen Evergreen
Documentation

CMake policy versions older than 3.5 are removed

Removed as of 2025-03-27. Replacement: cmake_minimum_required(VERSION 3.5) or newer, or VERSION <min>…<max> with <max> at least 3.5. Source: CMake 4.0 release notes (compatibility older than 3.5 removed).

Check a version:

evergreen check pkg:generic/cmake

CMake 4.0 removed compatibility with policy versions older than 3.5. A cmake_minimum_required(VERSION) or cmake_policy(VERSION) call that does not set the policy version to at least 3.5 (optionally via …<policy_max>) produces an error on CMake 4.0 and newer. CMake 4.0.0 was published on 2025-03-27.

Look up another package or runtime · <form action="../lookup.html" method="get" role="search"> </form>

   
Status Removed
Severity high
Ecosystem cpp
Component pkg:generic/cmake
Affected versions vers:semver/<3.5.0
Date from the source 2025-03-27
Replacement cmake_minimum_required(VERSION 3.5) or newer, or VERSION <min>…<max> with <max> at least 3.5
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.5.removed

Sources

Migration

Constraints

  • Raising the policy version can change NEW policy behavior; read the policies introduced between the old and new floor before committing.
  • Projects that must still configure on older CMake can use VERSION <min>…<max> so the minimum stays low while the policy max is at least 3.5 on newer CMake.

Steps

  1. Raise the reported cmake_minimum_required policy version. Change the reported cmake_minimum_required(VERSION …) so the effective policy version is at least 3.5 (for example VERSION 3.16, or VERSION 2.8.12…3.16).

Verification

  • cmake -S . -B build: Configure the project with a CMake 4.x toolchain and confirm the policy floor is accepted.

Detected by

The cpp detector. See Detectors and Compatibility.

Other versions of this product

Same ecosystem

Data

This page is generated from registry/cpp.json, rule cpp.cmake.policy-below-3.5.removed, 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