[CMake] Re: Demonstrated CMake.. received a few comments

Claus Klein claus.klein at arcormail.de
Tue Jan 23 15:45:13 EST 2007


On Tuesday 23 January 2007 18:10, kitts wrote:
> On Tuesday 23 January 2007 00:03 IST, kitts wrote:
> > 2) On windows, we would like to use VS as the IDE and KDevelop on linux.
> > Both are capable of crosscompiling (use non-native compilers). I think
> > this is only possible by setting CMAKE_C_COMPILER to the compiler to use?
> 
> I tested this today and alas, it doesn't work. :-(
> 
For me it works, but there are some points to know:

cd ~/src/wzdftpd/trunk/build && rm -f CMakeCache.txt &&
+ CC=/tools/LinuxPpcCDK/bin/powerpc-linux-gcc
+ CXX=/tools/LinuxPpcCDK/bin/powerpc-linux-g++
+ AR=/tools/LinuxPpcCDK/bin/powerpc-linux-ar
+ PKG_CONFIG_PATH=/tools/LinuxPpcCDK/lib/pkgconfig
+ CMAKE_LIBRARY_PATH=/tools/LinuxPpcCDK/lib:/tools/LinuxPpcCDK/usr/lib
+ CMAKE_INCLUDE_PATH=/tools/LinuxPpcCDK/include:/tools/LinuxPpcCDK/usr/include
+ cmake -DWITH_OpenSSL=ON -DWITH_TCLDev=OFF -DWITH_PerlDev=OFF -DWITH_GnuTLS=OFF -DWITH_PostgreSQL=OFF -DWITH_MySQL=OFF -DWITH_Zeroconf=OFF -DWITH_TESTS=OFF ..
-- Check for working C compiler: /tools/LinuxPpcCDK/bin/powerpc-linux-gcc
-- Check for working C compiler: /tools/LinuxPpcCDK/bin/powerpc-linux-gcc -- works
-- Check size of void*
-- Check size of void* - done
-- Found OpenSSL: /tools/LinuxPpcCDK/lib/libssl.so
-- Looking for pthread.h
-- Looking for pthread.h - found
...

You cannot change CMAKE_C_COMPILER without deleting the entire binary tree
and starting over. Once the compiler is set, it's set. This is one of the
few cmake variables that you cannot change once it has been set.

I found only one hint in http://www.cmake.org/Wiki/CMake_Useful_Variables
about cross-compile.

> CMake wasn't designed with cross-compiling in mind was it? I'm sure hoping 
> it fills this gap. I like it so much better than the competition. :-)
That is my opinion too.

PS: I use buildroot for our project, (see http://buildroot.uclibc.org/ ),
       to build the toolchain, the root-file system and the Application.

Bye
Claus


More information about the CMake mailing list