[CMake] R: Crosscompiling for arm linux on cmake 2.8.0
Luigi Grilli
luigi.grilli at elmo.it
Wed Apr 7 11:57:32 EDT 2010
Thanks Yegor!
That solved my problem.
-----Messaggio originale-----
Da: Yegor Yefremov [mailto:yegor_sub1 at visionsystems.de]
Inviato: mercoledì 7 aprile 2010 17.00
A: Luigi Grilli
Cc: cmake at cmake.org
Oggetto: Re: [CMake] Crosscompiling for arm linux on cmake 2.8.0
> 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.
Try to remove CMakeCache.txt file and execute cmake with the wrong toolchain file. You should get warning. And then try the proper file name and search CMakeCache.txt for COMPILER.
Best regards,
Yegor
More information about the CMake
mailing list