CMake "CMAKE_MAKE_PROGRAM is not set" in CI
CMake selected a generator but could not find the underlying build tool it drives (make or ninja). Without a build program it cannot generate the build system, so configuration stops.
What this error means
cmake fails with "CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool." after choosing a generator whose tool is absent.
cmake
CMake Error: CMake was unable to find a build program corresponding to "Unix
Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a
different build tool.Common causes
The build tool for the generator is not installed
The Unix Makefiles generator needs make; the Ninja generator needs ninja. A slim runner may have neither.
A cached generator points at a missing tool
A stale cache selected a generator whose program is not present in this runner image.
How to fix it
Install the build tool the generator needs
Install make for Unix Makefiles or ninja for the Ninja generator.
Terminal
sudo apt-get update
sudo apt-get install -y make ninja-build
cmake -S . -B buildSet CMAKE_MAKE_PROGRAM to the tool path
If the tool is in a custom prefix, point CMake at it explicitly.
Terminal
cmake -S . -B build -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja -G NinjaHow to prevent it
- Install the build tool that matches your chosen generator.
- Clean the build dir when switching generators so no stale program lingers.
- Verify the tool exists before configuring.
Related guides
CMake "-G Ninja" but ninja not found in CIFix CMake "-G Ninja" failing because ninja is not installed in CI - the Ninja generator needs the ninja execu…
CMake dirty cache / generator mismatch in a reused build dir in CIFix CMake "does not match the generator used previously" and stale CMakeCache.txt errors in CI - a reused bui…
make "No rule to make target" in CIFix make "*** No rule to make target X, needed by Y. Stop." in CI - a prerequisite file is missing and the Ma…