<HTML><BODY>
<div>&nbsp;</div>

<div>&nbsp;</div>
&nbsp;<br>
-----Original Message-----<br>
From: sonicmctails@aol.com<br>
To: a.neundorf-work@gmx.net<br>
Sent: Fri, 8 Sep 2006 4:06 PM<br>
Subject: Re: [CMake] Adding cross-compiler support to CMake ...<br>
<br>






<div id="AOLMsgPart_2_81cbd4d9-3fa5-4d89-88d7-fa1ce1c456df">



<div>lol, I actually intended to try cross-compiling KDE as a demostration of CMake's cross-compiling abilities once it was perfected.&nbsp; Anyway, autotools does have a difference for the CC, try searching for HOST_CC, BUILD_CC, and TARGET_CC (you probably won't find this one). I can see both approachs being viable, and probably doable. The trick then would be creating a native Makefile for programs that need to be built first, and then create a cross Makefile. The problem here is that CMake, under normal cirmstances, allows make to handle dependancies, but if we're dealing with two seperate build trees, then I'm not sure how we can handle building programs that. CMake just passing things in order to Make, which means that with two seperate build trees - our current generator isn't advanced enough to write a makefile that depends on targets in a second makefile (and to my knowledge, only GNU Make supports this, while I believe the UNIX Makefile generator creates something all flavors of make can handle). Now adding that is def. possibility, but I'm not sure if its going to be easier or harder to implement then just create a single makefile that handles both possibilities - doing this would require massive changes to the makefile generator, but then we don't have to manage any dependancies in CMake itself.<br>

<br>

Also, CTest and TRY_RUN will need patches so they can run remotely, but lets get things cross-compiling first.<br>

Michael<br>

</div>



<div>&nbsp;</div>

&nbsp;<br>

-----Original Message-----<br>

From: a.neundorf-work@gmx.net<br>

To: cmake@cmake.org<br>

Sent: Fri, 8 Sep 2006 3:31 PM<br>

Subject: Re: [CMake] Adding cross-compiler support to CMake ...<br>

<br>








<div id="AOLMsgPart_0_dcfd79be-b1e7-41b7-b052-8b0b386d0b78" class="AOLPlainTextBody">

<pre><tt>Hi,

Von: "William A. Hoffman" &lt;<a href="javascript:parent.ComposeTo('billlist%40nycap.rr.com');">billlist@nycap.rr.com</a>&gt;

...
&gt; The trouble is that in the case of 2, when you build
&gt; some sort of code generation executable as part of the build and run it
&gt; during
&gt; the build, it has to be built for the host or local machine.   

Exactly.
Just imagine somebody might want to cross-compile KDE...
...and I'm afraid that day will come.

But apart from that, two other things.
I'm using cmake daily for cross-compiling for an embedded target (eCos). There 
no configure tests (TRY_RUN/TRY_COMPILE) are required. The compiler are named 
arm-elf-gcc or powerpc-eabi-gcc, i.e. only a two-part prefix.

Basically all I do is:

SET(CMAKE_COMPILER_IS_GNUCXX 1)
SET(CMAKE_CXX_COMPILER "arm-elf-c++")
SET(CMAKE_C_COMPILER "arm-elf-gcc")
SET(CMAKE_AR "arm-elf-ar")
SET(CMAKE_RANLIB "arm-elf-ranlib")

and adjust the link command:

SET(CMAKE_CXX_LINK_EXECUTABLE  "&lt;CMAKE_CXX_COMPILER&gt; &lt;CMAKE_CXX_LINK_FLAGS&gt; 
&lt;OBJECTS&gt;  -o &lt;TARGET&gt; -nostdlib  -nostartfiles -L${CMAKE_CURRENT_SOURCE_DIR}/ecos/install/lib 
-Ttarget.ld")

This works even per-directory.
On this platform e.g. no dynamic linking exists, so many things are much more 
simple.

I almost have the impression that just setting a "toolchain-prefix" (e.g. 
"arm-elf-" goes already a long way.

Just my 2 cent.

Alex

-- 


"Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: <a href="http://www.gmx.net/de/go/topmail" target="_blank">http://www.gmx.net/de/go/topmail</a>
_______________________________________________
CMake mailing list
<a href="javascript:parent.ComposeTo('CMake%40cmake.org');">CMake@cmake.org</a>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a>
</tt></pre>
</div>

 



<div class="AOLPromoFooter">
<hr style="margin-top: 10px;">
<a href="http://pr.atwola.com/promoclk/1615326657x4311227241x4298082137/aol?redir=http%3A%2F%2Fwww%2Eaol%2Ecom" target="_blank"><b>Check out AOL.com today</b></a>. Breaking news, video search, pictures, email and IM. All on demand. Always Free.<br>

</div>


</div>
 <!-- end of AOLMsgPart_2_81cbd4d9-3fa5-4d89-88d7-fa1ce1c456df -->

    
</BODY></HTML>