The CMAKE_C_COMPILER / CMAKE_ASM_COMPILER: arm-none-eabi-gcc is not a full path and was not found in the PATH.

Hello friends,

I’ve recently started working with CMake and have run into a problem that I’ve been sitting on for a few days and can’t find a solution to.

I have an application (based on a ThreadX RTOS) which I want to build with a Ninja build system. I have created a CMakeLists.txt file in my application directory.

In this CMakeLists.txt I include ThreadX as a library.
(It is worth mentioning that the ThreadX files are not located in a subfolder of my project but in a different directory)

I get the following error message when I run cmake:
“The CMAKE_C_COMPILER: arm-none-eabi-gcc is not a full path and was not found in the PATH.”
“The CMAKE_ASM_COMPILER: arm-none-eabi-gcc is not a full path and was not found in the PATH.”

If I change the line inside the ThreadX CMakeLists.txt file:
“project(threadx LANGUAGES C ASM)”
to:
set(${PROJECT_NAME} threadx)

I get no error message and the Ninja build system is created. I am then also able to create a working executable via Ninja.

Everything runs inside a Docker container and when I look for the PATH variable inside a running container it gives me the following:
“/work/gcc-arm-none-eabi-10.3-2021.10/bin”

Obviously the path to the toolchain is stored in the PATH variable in the Docker container.

I have added the line:
message(“PATH: $ENV{PATH}”)

directly after the command:
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)

inside the ThreadX CMakeLists.txt file and the output of CMake was:
“/work/gcc-arm-none-eabi-10.3-2021.10/bin”

So CMake seems to find the toolchain PATH.

What am I doing wrong?
Can you please help me with that?

Greetings Daniel V.

Some things to try:

Enable the ASM language in your top level CMakeLists.txt file. You can just add ASM to the languages listed in the project() call within that file.

Take a look in the CMakeFiles/CmakeConfigureLog.yaml file in your build directory. Maybe there’s some clues in there that might uncover what’s happening.

Hi Craig,

thanks for your quick response.
The ASM language is already enabled in my top level CMakeLists.txt file.

project( Test_Project
VERSION 1.0.0
LANGUAGES C ASM)

CMake has not created a yaml file in the output directory.
It only created a cmake_install.cmake file.