<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.StileMessaggioDiPostaElettronica17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=IT link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span lang=EN-US>I’m trying to cross compile for ARM
with this command:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>cmake . -DCMAKE_BUILD_TYPE=DEBUG
-DCMAKE_TOOLCHAIN_FILE=arm-gcc3.4.5.cmake<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Here is my toolchain file:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>INCLUDE(CMakeForceCompiler)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US># this one is important<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>SET(CMAKE_SYSTEM_NAME Linux)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>set(CMAKE_SYSTEM_PROCESSOR arm)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>#this one not so much<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>SET(CMAKE_SYSTEM_VERSION 1)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US># specify the cross compiler<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>SET(CMAKE_C_COMPILER
arm-linux-gcc)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>SET(CMAKE_CXX_COMPILER arm-linux-g++)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US># where is the target environment<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>SET(CMAKE_FIND_ROOT_PATH /my-path-to-toolchain/arm-unknown-linux-gnu)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US># search for programs in the build host
directories<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
NEVER)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US># for libraries and headers in the target
directories<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>My cmake version is 2.8.0<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Anyway the “-DCMAKE_TOOLCHAIN_FILE”
option seems to be completely ignored (for example if I try to set a file that
doesn’t exists cmake doesn’t complain with that). In fact it always
does the makefile for the host system and not the target.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Is the toolchain manament different from
cmake 2.6? I read the documentation twice and they say to do exactly this way.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Any help will be appreciated.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Thanks<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
</div>
</body>
</html>