# What make command is used for try\_compile?

**URL:** https://discourse.cmake.org/t/what-make-command-is-used-for-try-compile/5331
**Category:** Code
**Created:** [March 30, 2022, 12:51pm UTC](https://discourse.cmake.org/t/what-make-command-is-used-for-try-compile/5331 "2022-03-30T12:51:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Detlef\_Vollmann](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/d/ce7236/32.png) [@Detlef\_Vollmann](https://discourse.cmake.org/u/Detlef_Vollmann)
#### Post date: [March 30, 2022, 12:51pm UTC](https://discourse.cmake.org/t/what-make-command-is-used-for-try-compile/5331/1 "2022-03-30T12:51:23Z")

</div>

Hello,

I’m trying to create my own toolchain file, but I’m getting  
a strange error message:

“[…] Run Build Command(s): -f Makefile cmTC\_7ea91/fast […]”

Obviously before “-f” the make command is missing.

This only happens if I use “set(CMAKE\_MAKE\_PROGRAM /usr/bin/make)”.

What do I need to set to make cmake work?

Here’s my cmake command:

cmake -DCMAKE\_TOOLCHAIN\_FILE=…/tc.cmake …

Here’s the toolchain file:

set(CMAKE\_FIND\_ROOT\_PATH /opt/avr)  
set(CMAKE\_FIND\_ROOT\_PATH\_MODE\_PROGRAM ONLY)  
set(CMAKE\_MAKE\_PROGRAM /usr/bin/make)

set(CMAKE\_SYSTEM\_NAME Generic)  
set(CMAKE\_SYSTEM\_PROCESSOR avr)  
set(CMAKE\_CROSSCOMPILING 1)

find\_program(AVR\_CC avr-gcc REQUIRED)  
set(CMAKE\_C\_COMPILER ${AVR\_CC})

Here’s the CMakeLists.txt:

cmake\_minimum\_required(VERSION 3.10)  
project(problem C)  
add\_executable(simple simple.c)

Here’s the output of “cmake --version”:

cmake version 3.23.0

CMake suite maintained and supported by Kitware ([kitware.com/cmake](http://kitware.com/cmake)).

The system is a Linux Debian unstable.

And for completeness, here’s simple.c:

int main()  
{  
return 0;  
}

Detlef
