<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>It is pretty much standard. I wrote the toolchain file adapting
different examples. <br>
</p>
<p>the Cmakelist is for the subdirectory of my parser (called
SIT_parser). The trick si that I use a custom command for
Lex/Yacc, so even when cross-compiling it is still correctly
called. <br>
</p>
<p><br>
</p>
<p>Michele<br>
</p>
<p><br>
</p>
<br>
<div class="moz-cite-prefix">Le 10/10/2016 à 12:48, Robert Bielik a
écrit :<br>
</div>
<blockquote
cite="mid:499fa9b6ed12467baa13928e9b1fb739@hosted3-mb01.itm.host"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<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;}
@font-face
{font-family:"Times New \,serif";
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;
color:black;}
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
{mso-style-priority:99;
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;
color:black;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-style-priority:99;
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;
color:black;}
span.EmailStyle19
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle20
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@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]-->
<div class="WordSection1">
<p class="MsoNormal"><font face="Calibri" color="black" size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;mso-fareast-language:EN-US"
lang="EN-US">Ok, I cannot get this to work. The source
files to be generated with add_custom_command have
property GENERATED set to ON, but cmake does not adhere,
and tries to use the tool binaries of the target system.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Calibri" color="black" size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;mso-fareast-language:EN-US"
lang="EN-US"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Calibri" color="black" size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;mso-fareast-language:EN-US"
lang="EN-US">Michele, would you be ok with sharing your
cmake code for this particular bit ?<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Calibri" color="black" size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;mso-fareast-language:EN-US"
lang="EN-US"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Calibri" color="black" size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;mso-fareast-language:EN-US"
lang="EN-US">Regards<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Calibri" color="black" size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;mso-fareast-language:EN-US"
lang="EN-US">/R<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Calibri" color="black" size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;mso-fareast-language:EN-US"
lang="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 face="Calibri" color="black"
size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;font-weight:bold"
lang="EN-US">From:</span></font></b><font
face="Calibri" color="black" size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext"
lang="EN-US"> portolan
[<a class="moz-txt-link-freetext" href="mailto:michele.portolan@imag.fr">mailto:michele.portolan@imag.fr</a>] <br>
<b><span style="font-weight:bold">Sent:</span></b>
den 10 oktober 2016 11:33<br>
<b><span style="font-weight:bold">To:</span></b>
Robert Bielik <a class="moz-txt-link-rfc2396E" href="mailto:Robert.Bielik@dirac.com"><Robert.Bielik@dirac.com></a>; Craig
Scott <a class="moz-txt-link-rfc2396E" href="mailto:craig.scott@crascit.com"><craig.scott@crascit.com></a><br>
<b><span style="font-weight:bold">Cc:</span></b>
<a class="moz-txt-link-abbreviated" href="mailto:Cmake@cmake.org">Cmake@cmake.org</a><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 face="Times New Roman"
color="black" size="3"><span style="font-size:12.0pt"
lang="EN-US"><o:p> </o:p></span></font></p>
<p><font face="Times New Roman" color="black" size="3"><span
style="font-size:12.0pt">I cannot answer your question:
I am a newcomer to Cmake (I have been using it for less
than 6 months) and on my build system I have 3.6, so I
never really looked at the previous versions. <o:p></o:p></span></font></p>
<p><font face="Times New Roman" color="black" size="3"><span
style="font-size:12.0pt">Sorry,<o:p></o:p></span></font></p>
<p><font face="Times New Roman" color="black" size="3"><span
style="font-size:12.0pt"><o:p> </o:p></span></font></p>
<p><font face="Times New Roman" color="black" size="3"><span
style="font-size:12.0pt">Michele<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Times New Roman"
color="black" size="3"><span style="font-size:12.0pt"><o:p> </o:p></span></font></p>
<div>
<p class="MsoNormal"><font face="Times New Roman"
color="black" size="3"><span style="font-size:12.0pt">Le
10/10/2016 à 11:30, Robert Bielik a écrit :<o:p></o:p></span></font></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><font face="Calibri" color="black"
size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;mso-fareast-language:EN-US">Thank
you Michele,</span></font><o:p></o:p></p>
<p class="MsoNormal"><font face="Calibri" color="black"
size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;mso-fareast-language:EN-US"> </span></font><o:p></o:p></p>
<p class="MsoNormal"><font face="Calibri" color="black"
size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;mso-fareast-language:EN-US"
lang="EN-US">This is exactly what I’m after. You
specify cmake v3.6 docs ? Is it only working from
3.6.x ? I have 3.5.2 on my build system.</span></font><o:p></o:p></p>
<p class="MsoNormal"><font face="Calibri" color="black"
size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;mso-fareast-language:EN-US"
lang="EN-US"> </span></font><o:p></o:p></p>
<p class="MsoNormal"><font face="Calibri" color="black"
size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;mso-fareast-language:EN-US"
lang="EN-US">Regards</span></font><o:p></o:p></p>
<p class="MsoNormal"><font face="Calibri" color="black"
size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;mso-fareast-language:EN-US"
lang="EN-US">/Robert</span></font><o:p></o:p></p>
<p class="MsoNormal"><font face="Calibri" color="black"
size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;mso-fareast-language:EN-US"
lang="EN-US"> </span></font><o:p></o:p></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 face="Calibri"
color="black" size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;font-weight:bold"
lang="EN-US">From:</span></font></b><font
face="Calibri" color="black" size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext"
lang="EN-US"> portolan [<a
moz-do-not-send="true"
href="mailto:michele.portolan@imag.fr">mailto:michele.portolan@imag.fr</a>]
<br>
<b><span style="font-weight:bold">Sent:</span></b>
den 10 oktober 2016 11:27<br>
<b><span style="font-weight:bold">To:</span></b>
Robert Bielik <a moz-do-not-send="true"
href="mailto:Robert.Bielik@dirac.com">
<Robert.Bielik@dirac.com></a>; Craig
Scott <a moz-do-not-send="true"
href="mailto:craig.scott@crascit.com">
<craig.scott@crascit.com></a><br>
<b><span style="font-weight:bold">Cc:</span></b>
<a moz-do-not-send="true"
href="mailto:Cmake@cmake.org">
Cmake@cmake.org</a><br>
<b><span style="font-weight:bold">Subject:</span></b>
Re: [CMake] Crosscompilation woes</span></font><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><font face="Times New Roman"
color="black" size="3"><span style="font-size:12.0pt"> <o:p></o:p></span></font></p>
<p><font face="Times New Roman" color="black" size="3"><span
style="font-size:12.0pt">In my project I build on
Linux i686 and I use a Toolchain file to specify the
ARM cross-compiler<o:p></o:p></span></font></p>
<p><font face="Times New Roman" color="black" size="3"><span
style="font-size:12.0pt"><a moz-do-not-send="true"
href="https://cmake.org/cmake/help/v3.6/manual/cmake-toolchains.7.html">https://cmake.org/cmake/help/v3.6/manual/cmake-toolchains.7.html</a>
<o:p></o:p></span></font></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><font
face="Times New Roman" color="black" size="3"><span
style="font-size:12.0pt">The nice thing is that if
you mark some files as "generated" CMAKE will
automatically use the build rather than the target
toolchains. For instance, I have a Flex/Byson
compiler that is generated locally on i686 , but
then compiled for ARM.
<br>
<br>
Regards,<br>
<br>
Michele <o:p></o:p></span></font></p>
<div>
<p class="MsoNormal"><font face="Times New Roman"
color="black" size="3"><span
style="font-size:12.0pt">Le 10/10/2016 à 11:10,
Robert Bielik a écrit :<o:p></o:p></span></font></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><font face="Calibri" color="black"
size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Thanks
Craig,</span></font><o:p></o:p></p>
<p class="MsoNormal"><font face="Calibri" color="black"
size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"> </span></font><o:p></o:p></p>
<p class="MsoNormal"><font face="Calibri" color="black"
size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"
lang="EN-US">Your solution will work for me I
think.</span></font><o:p></o:p></p>
<p class="MsoNormal"><font face="Calibri" color="black"
size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"
lang="EN-US"> </span></font><o:p></o:p></p>
<p class="MsoNormal"><font face="Calibri" color="black"
size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"
lang="EN-US">Regards</span></font><o:p></o:p></p>
<p class="MsoNormal"><font face="Calibri" color="black"
size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"
lang="EN-US">/R</span></font><o:p></o:p></p>
<p class="MsoNormal"><font face="Calibri" color="black"
size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"
lang="EN-US"> </span></font><o:p></o:p></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 face="Calibri"
color="black" size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;font-weight:bold"
lang="EN-US">From:</span></font></b><font
face="Calibri" size="2"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif"
lang="EN-US"> Craig Scott [<a
moz-do-not-send="true"
href="mailto:craig.scott@crascit.com">mailto:craig.scott@crascit.com</a>]
<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 <a moz-do-not-send="true"
href="mailto:Robert.Bielik@dirac.com">
<Robert.Bielik@dirac.com></a><br>
<b><span style="font-weight:bold">Cc:</span></b>
<a moz-do-not-send="true"
href="mailto:Cmake@cmake.org">
Cmake@cmake.org</a><br>
<b><span style="font-weight:bold">Subject:</span></b>
Re: [CMake] Crosscompilation woes</span></font><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><font face="Times New Roman"
color="black" size="3"><span
style="font-size:12.0pt"> <o:p></o:p></span></font></p>
<div>
<p class="MsoNormal"><font face="Times New Roman"
color="black" size="3"><span
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 face="Times New Roman"
color="black" size="3"><span
style="font-size:12.0pt"> <o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font face="Times New Roman"
color="black" size="3"><span
style="font-size:12.0pt"><a
moz-do-not-send="true"
href="http://stackoverflow.com/q/36084785/1938798">http://stackoverflow.com/q/36084785/1938798</a><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font face="Times New Roman"
color="black" size="3"><span
style="font-size:12.0pt"> <o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font face="Times New Roman"
color="black" size="3"><span
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
<a moz-do-not-send="true"
href="https://cmake.org/cmake/help/latest/module/ExternalProject.html">ExternalProject</a>,
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></font></p>
</div>
<div>
<p class="MsoNormal"><font face="Times New Roman"
color="black" size="3"><span
style="font-size:12.0pt"> <o:p></o:p></span></font></p>
</div>
</div>
<div>
<p class="MsoNormal"><font face="Times New Roman"
color="black" size="3"><span
style="font-size:12.0pt"> <o:p></o:p></span></font></p>
<div>
<p class="MsoNormal"><font face="Times New Roman"
color="black" size="3"><span
style="font-size:12.0pt">On Mon, Oct 10,
2016 at 7:29 PM, Robert Bielik <<a
moz-do-not-send="true"
href="mailto:Robert.Bielik@dirac.com"
target="_blank">Robert.Bielik@dirac.com</a>>
wrote:<o:p></o:p></span></font></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 face="Times New
Roman" color="black" size="3"><span
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 <a moz-do-not-send="true"
href="http://www.kitware.com"
target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check
the CMake FAQ at: <a
moz-do-not-send="true"
href="http://www.cmake.org/Wiki/CMake_FAQ"
target="_blank">
http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support
the CMake community. For more information
on each offering, please visit:<br>
<br>
CMake Support: <a moz-do-not-send="true"
href="http://cmake.org/cmake/help/support.html" target="_blank">
http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a
moz-do-not-send="true"
href="http://cmake.org/cmake/help/consulting.html"
target="_blank">
http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a
moz-do-not-send="true"
href="http://cmake.org/cmake/help/training.html"
target="_blank">
http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects
at <a moz-do-not-send="true"
href="http://www.kitware.com/opensource/opensource.html"
target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a moz-do-not-send="true"
href="http://public.kitware.com/mailman/listinfo/cmake"
target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><o:p></o:p></span></font></p>
</blockquote>
</div>
<p class="MsoNormal"><font face="Times New Roman"
color="black" size="3"><span
style="font-size:12.0pt"><br>
<br clear="all">
<o:p></o:p></span></font></p>
<div>
<p class="MsoNormal"><font face="Times New Roman"
color="black" size="3"><span
style="font-size:12.0pt"> <o:p></o:p></span></font></p>
</div>
<p class="MsoNormal"><font face="Times New Roman"
color="black" size="3"><span
style="font-size:12.0pt">--
<o:p></o:p></span></font></p>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><font face="Times
New ,serif" color="black" size="3"><span
style="font-size:12.0pt;font-family:"Times New ,serif",serif">Craig
Scott</span></font><o:p></o:p></p>
<div>
<p class="MsoNormal"><font face="Times
New ,serif" color="black" size="3"><span
style="font-size:12.0pt;font-family:"Times New ,serif",serif">Melbourne,
Australia</span></font><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><font face="Times
New ,serif" color="black" size="3"><span
style="font-size:12.0pt;font-family:"Times New ,serif",serif"><a
moz-do-not-send="true"
href="https://crascit.com"
target="_blank">https://crascit.com</a></span></font><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><font face="Times New Roman"
color="black" size="3"><span
style="font-size:12.0pt"><br>
<br>
<br>
<o:p></o:p></span></font></p>
</blockquote>
<p class="MsoNormal"><font face="Times New Roman"
color="black" size="3"><span style="font-size:12.0pt"> <o:p></o:p></span></font></p>
</div>
</blockquote>
<p class="MsoNormal"><font face="Times New Roman"
color="black" size="3"><span style="font-size:12.0pt"><o:p> </o:p></span></font></p>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
<br>
</body>
</html>