<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div style="font-family: Verdana; font-size: 12px;"><span style="line-height: 1.6em;">Hello I am new to cmake,</span></div>

<div style="font-family: Verdana; font-size: 12px;">
<div> </div>

<div>I have two question´s concerning cross compiling with gnu compilers</div>

<div> </div>

<div>1) First Question: Can anyone explain me, why a toolchain file is called twice when cross compiling? I use the current cmake version 3.2.2.</div>

<div> </div>

<div>I use this toolchain file as an example...</div>

<div> </div>

<div># the name of the target operating system<br/>
SET(CMAKE_SYSTEM_NAME Windows)</div>

<div>message(STATUS "cross compiling with mingw32")</div>

<div># which compilers to use for C and C++<br/>
SET(TOOLCHAIN_PATH "c:/MinGW32/bin")<br/>
SET(CMAKE_C_COMPILER ${TOOLCHAIN_PATH}/gcc.exe)<br/>
SET(CMAKE_CXX_COMPILER ${TOOLCHAIN_PATH}/g++.exe)<br/>
SET(CMAKE_RC_COMPILER ${TOOLCHAIN_PATH}/windres.exe)</div>

<div># here is the target environment located<br/>
SET(CMAKE_FIND_ROOT_PATH /MinGW32/bin)</div>

<div># adjust the default behavior of the FIND_XXX() commands:<br/>
# search headers and libraries in the target environment, search <br/>
# programs in the host environment<br/>
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)<br/>
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)<br/>
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)</div>

<div> </div>

<div>.. but the same happens whit other toolchain files => as an example on cross compiling for GNU ARM.</div>

<div> </div>

<div>2) Second Question: </div>

<div> </div>

<div>Is there a common way to select a specific Compiler and Compiler Version?</div>

<div> </div>

<div>thx for the help</div>

<div>regards,</div>

<div>mathias</div>
</div>
</div></div></body></html>