{
  "schemaVersion": "ebb.rule.v1",
  "id": "cpp.cmake.policy-below-3.10.deprecated",
  "ecosystem": "cpp",
  "purl": "pkg:generic/cmake",
  "affectedVersions": "vers:semver/>=3.5.0|<3.10.0",
  "event": "deprecated",
  "severity": "medium",
  "title": "CMake policy versions older than 3.10 are deprecated",
  "summary": "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.",
  "replacement": "cmake_minimum_required(VERSION 3.10) or newer, or VERSION <min>...<max> with <max> at least 3.10",
  "deadline": "2024-11-06",
  "sources": [
    {
      "title": "CMake 3.31 release notes (compatibility older than 3.10 deprecated)",
      "url": "https://cmake.org/cmake/help/latest/release/3.31.html",
      "accessedAt": "2026-10-19"
    },
    {
      "title": "cmake_minimum_required (Changed in 3.31)",
      "url": "https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html",
      "accessedAt": "2026-10-19"
    },
    {
      "title": "CMake 3.31.0 GitHub release",
      "url": "https://github.com/Kitware/CMake/releases/tag/v3.31.0",
      "accessedAt": "2026-10-19"
    }
  ],
  "provenance": {
    "observedAt": "2026-10-19",
    "reviewedAt": "2026-10-19",
    "reviewer": "arminazimi"
  },
  "migration": {
    "constraints": [
      "Raising the policy version can change NEW policy behavior; read the policies introduced between the old and new floor before committing."
    ],
    "steps": [
      {
        "id": "raise-cmake-policy-floor",
        "title": "Raise the reported cmake_minimum_required policy version",
        "instructions": "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).",
        "targets": "declaration"
      }
    ],
    "verification": [
      {
        "command": "cmake -S . -B build -Wdev",
        "purpose": "Configure with developer warnings enabled and confirm the policy-floor deprecation is gone."
      }
    ]
  }
}
