<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>Hi,</div>

<div>currently I am working with cmake 3.9.0 on windows 10.</div>

<div>I want to use cmake to crosscompile some C sources with armclang.<br/>
The wiki page contains a section called "The toolchain file" (see <a href="https://deref-web-02.de/mail/client/di__f_6XC-c/dereferrer/?redirectUrl=https%3A%2F%2Fcmake.org%2FWiki%2FCMake_Cross_Compiling" target="_blank">https://cmake.org/Wiki/CMake_Cross_Compiling</a>).</div>

<div>My toolchain file looks as follows:</div>

<div>SET(CMAKE_SYSTEM_NAME Generic)     # Target is an embedded system without OS<br/>
SET(CMAKE_SYSTEM_PROCESSOR arm)    # The name of the cpu cmake is building for ARM</div>

<div>SET(CMAKE_C_COMPILER "C:/Program Files/ARMCompiler6.6.1/bin/armclang.exe")<br/>
SET(CMAKE_CXX_COMPILER "C:/Program Files/ARMCompiler6.6.1/bin/armclang.exe")<br/>
SET(CMAKE_ASM_COMPILER "C:/Program Files/ARMCompiler6.6.1/bin/armasm.exe")<br/>
SET(CMAKE_LINKER "C:/Program Files/ARMCompiler6.6.1/bin/armlink.EXE")<br/>
SET(FROMELF "C:/Program Files/ARMCompiler6.6.1/bin/fromelf.EXE")</div>

<div><br/>
The cmake execution leads to the following output:</div>

<div>==================================================================================================<br/>
A subdirectory or file CMakeMakefile already exists.<br/>
-- The C compiler identification is unknown<br/>
-- The ASM compiler identification is ARMCC<br/>
-- Found assembler: C:/Program Files/ARMCompiler6.6.1/bin/armasm.exe<br/>
-- Check for working C compiler: C:/Program Files/ARMCompiler6.6.1/bin/armclang.exe<br/>
-- Check for working C compiler: C:/Program Files/ARMCompiler6.6.1/bin/armclang.exe -- broken</div>

<div>...</div>

<div> <br/>
  armclang.exe: fatal error: no target architecture given; use<br/>
  --target=arm-arm-none-eabi or --target=aarch64-arm-none-eabi</div>

<div>...</div>

<div><br/>
  CMake will not be able to correctly generate this project.<br/>
Call Stack (most recent call first):<br/>
  CMakeLists.txt:14 (project)</div>

<div><br/>
-- Configuring incomplete, errors occurred!<br/>
See also "CMakeMakefile/CMakeFiles/CMakeOutput.log".<br/>
See also "CMakeMakefile/CMakeFiles/CMakeError.log".</div>

<div>==================================================================================================</div>

<div><br/>
The CMakeError.log looks as follows:</div>

<div>==================================================================================================<br/>
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.<br/>
Compiler: C:/Program Files/ARMCompiler6.6.1/bin/armclang.exe<br/>
Build flags:<br/>
Id flags:  </div>

<div>The output was:<br/>
1<br/>
armclang.exe: fatal error: no target architecture given; use --target=arm-arm-none-eabi or --target=aarch64-arm-none-eabi</div>

<div><br/>
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.<br/>
Compiler: C:/Program Files/ARMCompiler6.6.1/bin/armclang.exe<br/>
Build flags:<br/>
Id flags: -c</div>

<div>The output was:<br/>
1<br/>
armclang.exe: fatal error: no target architecture given; use --target=arm-arm-none-eabi or --target=aarch64-arm-none-eabi</div>

<div><br/>
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.<br/>
Compiler: C:/Program Files/ARMCompiler6.6.1/bin/armclang.exe<br/>
Build flags:<br/>
Id flags: -Aa</div>

<div>The output was:<br/>
1<br/>
armclang.exe: fatal error: no target architecture given; use --target=arm-arm-none-eabi or --target=aarch64-arm-none-eabi</div>

<div><br/>
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.<br/>
Compiler: C:/Program Files/ARMCompiler6.6.1/bin/armclang.exe<br/>
Build flags:<br/>
Id flags: -D__CLASSIC_C__</div>

<div>The output was:<br/>
1<br/>
armclang.exe: fatal error: no target architecture given; use --target=arm-arm-none-eabi or --target=aarch64-arm-none-eabi</div>

<div><br/>
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.<br/>
Compiler: C:/Program Files/ARMCompiler6.6.1/bin/armclang.exe<br/>
Build flags:<br/>
Id flags:  </div>

<div>The output was:<br/>
1<br/>
armclang.exe: fatal error: no target architecture given; use --target=arm-arm-none-eabi or --target=aarch64-arm-none-eabi</div>

<div><br/>
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.<br/>
Compiler: C:/Program Files/ARMCompiler6.6.1/bin/armclang.exe<br/>
Build flags:<br/>
Id flags: -c</div>

<div>...<br/>
==================================================================================================</div>

<div>The compiler identification seems to fail.</div>

<div><br/>
Further on I was checking the possibility of "CMakeForceCompiler". But for version 3.9 this option is deprecated<br/>
(see <a href="https://deref-web-02.de/mail/client/dTI7icaMouo/dereferrer/?redirectUrl=https%3A%2F%2Fcmake.org%2Fcmake%2Fhelp%2Fv3.9%2Fmodule%2FCMakeForceCompiler.html%3Fhighlight%3Dcmakeforcecompiler" target="_blank">https://cmake.org/cmake/help/v3.9/module/CMakeForceCompiler.html?highlight=cmakeforcecompiler</a>)</div>

<div>The CMAKE_TRY_COMPILE_TARGET_TYPE was instead recommended.</div>

<div>In my case neither set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) nor set(CMAKE_TRY_COMPILE_TARGET_TYPE EXECUTABLE) was working.<br/>
The error message was still the same.</div>

<div>Can you give me some advice?<br/>
How can I switch of the compiler checks?</div>

<div>Thanks a lot for your help.</div>

<div>Best regards.</div>
</div></div></body></html>