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.3Common causes
How to fix it
Install a newer CMake
- Install CMake from Kitware APT/pip rather than the old distro package.
- Pin the CMake version in the runner image to match the project minimum.
cmake
pip install "cmake>=3.20"
cmake --versionHow 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
CMake "generator Ninja not found" in CIFix CMake "Ninja" generator errors in CI - the Ninja build tool is not installed, so CMake cannot use the -G…
CMake "No CMAKE_C_COMPILER could be found" in CIFix CMake "No CMAKE_C_COMPILER could be found" in CI - no C compiler is installed or on PATH for the project…
CMake "Cannot find source file" in CIFix CMake "Cannot find source file" in CI - a file listed in add_executable/add_library does not exist at the…