Skip to content
Latchkey

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 build

Set 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 Ninja

How 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →