Skip to content
Latchkey

CMake "CMake X requires version Y" in CI

The project (or a dependency) declares a minimum CMake version higher than the one installed. The old CMake on the runner refuses to configure.

What this error means

Configure stops with a message that CMake of at least version X.Y is required, usually on an image with a stale distro CMake.

cmake
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
  CMake 3.20 or higher is required.  You are running version 3.16.3

Common causes

How to fix it

Install a newer CMake

  1. Install CMake from Kitware APT/pip rather than the old distro package.
  2. Pin the CMake version in the runner image to match the project minimum.
cmake
pip install "cmake>=3.20"
cmake --version

How to prevent it

  • Provision a CMake version at or above your project minimum in the runner image and pin it.

Frequently asked questions

What causes ""requires a newer version of CMake""?
Configure stops with a message that CMake of at least version X.Y is required, usually on an image with a stale distro CMake.
How do I fix "requires a newer version of CMake"?
Install a newer CMake

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card