# Problem when setting CMAKE\_MAKE\_PROGRAM in toolchain file

**URL:** https://discourse.cmake.org/t/problem-when-setting-cmake-make-program-in-toolchain-file/15471
**Category:** Usage
**Created:** [January 21, 2026, 1:56pm UTC](https://discourse.cmake.org/t/problem-when-setting-cmake-make-program-in-toolchain-file/15471 "2026-01-21T13:56:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![dareg](https://discourse.cmake.org/user_avatar/discourse.cmake.org/dareg/32/5989_2.png) [@dareg](https://discourse.cmake.org/u/dareg)
#### Post date: [January 21, 2026, 1:56pm UTC](https://discourse.cmake.org/t/problem-when-setting-cmake-make-program-in-toolchain-file/15471/1 "2026-01-21T13:56:04Z")

</div>

Hello,

I am trying to set the CMAKE\_MAKE\_PROGRAM to a specific binary with a toolchain file. But when running cmake it fails with a strange message. Is there something specific I am missing, or is it just a bug I should open a ticket for?

I am using cmake 4.0.2

The toolchain file contains only:

```auto
set (CMAKE_MAKE_PROGRAM “/usr/bin/gmake”)

```

The CMakeLists.txt:

```auto
cmake_minimum_required (VERSION 4.0 FATAL_ERROR)
project (test)
add_executable (main main.cpp)
message (“CMAKE_AR=${CMAKE_AR}”)
message (“CMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}”)

```

And when I run the command from the build directory:

```auto
$ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake ..
-- The C compiler identification is GNU 8.5.0
-- The CXX compiler identification is GNU 8.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc - broken
CMake Error at /usr/local/apps/cmake/4.0.2/share/cmake-4.0/Modules/CMakeTestCCompiler.cmake:67 (message):
  The C compiler

    "/usr/bin/gcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/home/fra4240/cmake_ar/build/CMakeFiles/CMakeScratch/TryCompile-fqYYF5'
    
    Run Build Command(s): /usr/local/apps/cmake/4.0.2/bin/cmake -E env VERBOSE=1 "" -f Makefile cmTC_ad399/fast
    no such file or directory
    
  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)

-- Configuring incomplete, errors occurred!

```

---

<div class="post-metadata">

### Author: ![dareg](https://discourse.cmake.org/user_avatar/discourse.cmake.org/dareg/32/5989_2.png) [@dareg](https://discourse.cmake.org/u/dareg)
#### Post date: [January 27, 2026, 9:24am UTC](https://discourse.cmake.org/t/problem-when-setting-cmake-make-program-in-toolchain-file/15471/2 "2026-01-27T09:24:51Z")

</div>

I’ve just tried on another computer with the last cmake version (4.2.2), and I am still getting the same error. Does anyone have a clue of what’s happening here ?

---

<div class="post-metadata">

### Author: ![dareg](https://discourse.cmake.org/user_avatar/discourse.cmake.org/dareg/32/5989_2.png) [@dareg](https://discourse.cmake.org/u/dareg)
#### Post date: [January 28, 2026, 2:27pm UTC](https://discourse.cmake.org/t/problem-when-setting-cmake-make-program-in-toolchain-file/15471/3 "2026-01-28T14:27:34Z")

</div>

A workaround was given by Brad King:

toolcahin.cmake:  
`set(CMAKE_MAKE_PROGRAM "/usr/bin/gmake" CACHE PATH "Path to make")`

See [https://gitlab.kitware.com/cmake/cmake/-/issues/27546](https://gitlab.kitware.com/cmake/cmake/-/issues/27546)
