[CMake] Crosscompiling for arm linux on cmake 2.8.0

Luigi Grilli luigi.grilli at elmo.it
Wed Apr 7 09:50:57 EDT 2010


I'm trying to cross compile for ARM with this command:

 

cmake . -DCMAKE_BUILD_TYPE=DEBUG
-DCMAKE_TOOLCHAIN_FILE=arm-gcc3.4.5.cmake

 

Here is my toolchain file:

 

INCLUDE(CMakeForceCompiler)

 

# this one is important

SET(CMAKE_SYSTEM_NAME Linux)

set(CMAKE_SYSTEM_PROCESSOR arm)

 

#this one not so much

SET(CMAKE_SYSTEM_VERSION 1)

 

# specify the cross compiler

SET(CMAKE_C_COMPILER   arm-linux-gcc)

SET(CMAKE_CXX_COMPILER arm-linux-g++)

 

# where is the target environment

SET(CMAKE_FIND_ROOT_PATH  /my-path-to-toolchain/arm-unknown-linux-gnu)

 

# search for programs in the build host directories

SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

# for libraries and headers in the target directories

SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)

SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

 

 

My cmake version is 2.8.0

 

Anyway the "-DCMAKE_TOOLCHAIN_FILE" option seems to be completely
ignored (for example if I try to set a file that doesn't exists cmake
doesn't complain with that). In fact it always does the makefile for the
host system and not the target.

 

Is the toolchain manament different from cmake 2.6? I read the
documentation twice and they say to do exactly this way.

Any help will be appreciated.

Thanks

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100407/4a396515/attachment.htm>


More information about the CMake mailing list