I am new to CMake and I am trying to create CMake for existing project which has to crosscompile ARM code on multiple Linux and Windows machines so hard coding path to compiler is not an option. So far path to compiler was added to each user path so you can just call armcc from console and correct compiler version would execute. I haven't found a way to specify compiler like that in CMake I tried:
SET(CMAKE_C_COMPILER "armcc")- It returns: The CMAKE_C_COMPILER: armcc is not a full path and was not found in the PATH.find_program(CMAKE_C_COMPILER NAMES armcc)- it always returns /usr/bin/cc
I am sure that first message is not true because path to armcc is in PATH variable. I am using cmake version 3.6.2.
set(CMAKE_C_COMPILER armcc)command located? It should be placed before the project call to take effect. And as you mentioned crosscompilingCMAKE_TOOLCHAIN_FILEare the proposed way to go. - vre