[CMake] Adding cross-compiler support to CMake ...

Michael Casadevall sonicmctails at aol.com
Fri Sep 8 18:50:28 EDT 2006


It would just need to be in the cross-compiler's directory. The test  
needs to do TRY_COMPILE on the cross-compiler, and as long as it  
compiles, the library is in the right place. TRY_RUN should be able  
to run tests remotely, or have a manual answer put in place just  
incase the target hardware is unavailable. TRY_RUN will have to be  
modified so the test should first try it in shared mode. If that  
fails, try it again statically, and if that works, print a warning  
that target device is lacking library x, and CMake will default to  
static building. Now I haven't poked through the FindFoo.cmake  
packages, but if it works by testing via compiling, then it won't be  
a problem.

In regards to BIG_ENDIAN/LITTLE_ENDIAN, I've never met a compiler  
that hasn't defined the right one, but we shouldn't be dependent on  
that. We could provide a list of common arch types and their default  
endian settlings, but that wouldn't do anything for MIPS, ARM, or  
PowerPC 7405 and earlier, since all three of those processors are bi- 
endian, although the PowerPC chip can run both big and little endian  
programs on the same platform, although that can have issues.

Ideally, assuming a properly written CMakeLists.txt (TRY_RUN/ 
TRY_COMPILE is right, or remote hardware is available), cross- 
compiling should be as trivial as compiling locally. With any luck,  
once this is true, it will help grow CMake's userbase, because I can  
think quite a few situations I want to run a program on my old  
desktop, but don't want to spend a month compiling it (I do know of  
distcc, but that has its own set of problems, including it does the  
compiling on the target hardware which means it needs a harddrive).  
I'm starting to get a good picture on how this is going to work out,  
and perpahs we could extend this that you can cross-compile to  
multiple platforms at once, which would be great for systems like  
Debian which cross-compile quite a few packages AFAIK.
Michael

On Sep 8, 2006, at 4:33 PM, Alexander Neundorf wrote:

>
>>  From: sonicmctails at aol.com
>>  To: a.neundorf-work at gmx.net
>>  Sent: Fri, 8 Sep 2006 4:06 PM
>>  Subject: Re: [CMake] Adding cross-compiler support to CMake ...
>>
>>   lol, I actually intended to try cross-compiling KDE as a  
>> demostration
>> of CMake's cross-compiling abilities once it was perfected.
>
> Once it is possible to do this, the cross-compiling abilities are  
> really perfect.
> In KDE we do about one million configure checks, checking the  
> availability of various functions, types and headers. And we use  
> many extra libraries, which are found using FIND_PACKAGE().
>
> How should all that work when cross-compiling ?
> The FindFoo.cmake files as far as I can see cannot and are not  
> written to find libraries in strange directories for cross-compiling.
> All the values could be set manually by hand, but this is not  
> really doable for a project with so many checks.
>
> Bye
> Alex
>
> -- 
>
>
> Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list