<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: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=utf-8">
<meta name="Generator" content="Microsoft Word 15 (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:12.0pt;
        font-family:"Times New Roman",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;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></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="SV" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><font size="2" face="Calibri"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">I’m trying to do this, but since I setup a cross compiling env. by setting C&C++ compiler, these settings
 get used when I run execute_process to setup the host build !! Thus I get the ARM version of the build tools anyway! :(<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Calibri"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Calibri"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">It seems that when execute_process is executed, the CC and CXX environment variables are set, which makes
 cmake use those when generating the makefiles.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Calibri"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Calibri"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Ideas are most welcome!<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Calibri"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Calibri"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Regards<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Calibri"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">/R<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Calibri"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></font></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><font size="2" face="Calibri"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;font-weight:bold">From:</span></font></b><font size="2" face="Calibri"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">
 Craig Scott [mailto:craig.scott@crascit.com] <br>
<b><span style="font-weight:bold">Sent:</span></b> den 10 oktober 2016 10:47<br>
<b><span style="font-weight:bold">To:</span></b> Robert Bielik <Robert.Bielik@dirac.com><br>
<b><span style="font-weight:bold">Cc:</span></b> Cmake@cmake.org<br>
<b><span style="font-weight:bold">Subject:</span></b> Re: [CMake] Crosscompilation woes<o:p></o:p></span></font></p>
</div>
</div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span lang="EN-US" style="font-size:12.0pt"><o:p> </o:p></span></font></p>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span lang="EN-US" style="font-size:12.0pt">Here's one possible solution (not perfect, but has been working in production for us for a while now for a similar scenario to what you describe):<o:p></o:p></span></font></p>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span lang="EN-US" style="font-size:12.0pt"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"><a href="http://stackoverflow.com/q/36084785/1938798"><span lang="EN-US">http://stackoverflow.com/q/36084785/1938798</span></a></span></font><span lang="EN-US"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span lang="EN-US" style="font-size:12.0pt"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span lang="EN-US" style="font-size:12.0pt">An alternative is a superbuild arrangement which would require a top level project to drive two sub-builds brought in via
</span><a href="https://cmake.org/cmake/help/latest/module/ExternalProject.html"><span lang="EN-US">ExternalProject</span></a></font><span lang="EN-US">, one for the host and the other for arm. This is both better and worse, depending on your point of view,
 so you may need to do some research/experimenting to see which is a better fit for your situation.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span lang="EN-US" style="font-size:12.0pt"><o:p> </o:p></span></font></p>
</div>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span lang="EN-US" style="font-size:12.0pt"><o:p> </o:p></span></font></p>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span lang="EN-US" style="font-size:12.0pt">On Mon, Oct 10, 2016 at 7:29 PM, Robert Bielik <</span><a href="mailto:Robert.Bielik@dirac.com" target="_blank"><span lang="EN-US">Robert.Bielik@dirac.com</span></a></font><span lang="EN-US">>
 wrote:<o:p></o:p></span></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<p class="MsoNormal"><font size="3" face="Times New Roman"><span lang="EN-US" style="font-size:12.0pt">Hi all,<br>
<br>
I am crosscompiling a project for arm (on linux i686), and use codegeneration tools within the project (together with add_custom_command). Of course, this will fail, since the tools are compiled for arm also and thus won't execute on my host system. So the
 tools need to be compiled for i686 whilst the rest for arm. I'm sure this can be handled by CMake although haven't done it before so would appreciate pointers :)<br>
<br>
Regards<br>
/Robert<br>
<br>
--<br>
<br>
Powered by </span><a href="http://www.kitware.com" target="_blank"><span lang="EN-US">www.kitware.com</span></a></font><span lang="EN-US"><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: </span><a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank"><span lang="EN-US">http://www.cmake.org/Wiki/CMake_FAQ</span></a><span lang="EN-US"><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: </span><a href="http://cmake.org/cmake/help/support.html" target="_blank"><span lang="EN-US">http://cmake.org/cmake/help/support.html</span></a><span lang="EN-US"><br>
CMake Consulting: </span><a href="http://cmake.org/cmake/help/consulting.html" target="_blank"><span lang="EN-US">http://cmake.org/cmake/help/consulting.html</span></a><span lang="EN-US"><br>
CMake Training Courses: </span><a href="http://cmake.org/cmake/help/training.html" target="_blank"><span lang="EN-US">http://cmake.org/cmake/help/training.html</span></a><span lang="EN-US"><br>
<br>
Visit other Kitware open-source projects at </span><a href="http://www.kitware.com/opensource/opensource.html" target="_blank"><span lang="EN-US">http://www.kitware.com/opensource/opensource.html</span></a><span lang="EN-US"><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
</span><a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank"><span lang="EN-US">http://public.kitware.com/mailman/listinfo/cmake</span></a><span lang="EN-US"><o:p></o:p></span></p>
</blockquote>
</div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span lang="EN-US" style="font-size:12.0pt"><br>
<br clear="all">
<o:p></o:p></span></font></p>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span lang="EN-US" style="font-size:12.0pt"><o:p> </o:p></span></font></p>
</div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span lang="EN-US" style="font-size:12.0pt">--
<o:p></o:p></span></font></p>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span lang="EN-US" style="font-size:12.0pt">Craig Scott<o:p></o:p></span></font></p>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span lang="EN-US" style="font-size:12.0pt">Melbourne, Australia<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"><a href="https://crascit.com" target="_blank"><span lang="EN-US">https://crascit.com</span></a></span></font><span lang="EN-US"><o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>