CMake toolchain file linker step ignored

For a project I want to cross-compile with the compiler of Texas Instrument.

So I created a Toolchain file in which I wrote:


But when I build the project with this toolchain file I figured out that the linker step is not the one I defined with that previous variable. I found that there is already a definition of the compiler of Texas Instrument in the folder of CMake (at cmake/share/cmake-3.18/Modules/Compiler/TI-C.cmake. The problem is that CMake is using the toolchain defined in the CMake installation folder instead of the one I defined.

  • Do you know why ?
  • How to supplant the toolchain of the cmake installation folder ?

Thanks ;)