[CMake] improve cross compilation

Wim Van Loocke wimvanloocke at gmail.com
Wed Mar 26 15:40:15 EDT 2014


Hi All,


The way the cross-compiling is described with a separated file  with the
cross-compilation is working

set(COMPILER_PATH /opt/Xilinx/SDK/2013.4/gnu/arm/lin/bin/)

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR arm)

# specify the cross compiler
set (CMAKE_C_COMPILER ${COMPILER_PATH}arm-xilinx-linux-gnueabi-gcc )
set (CMAKE_CXX_COMPILER ${COMPILER_PATH}arm-xilinx-linux-gnueabi-g++ )

I have looked into the code and see that in CMakeSystem.cmake the toolchain
parameters are added, and this is kept as the build system.  This is done
even before parsing much of the CMakeLists.txt file.

As such only via the -DCMAKE_TOOLCHAIN_FILE this file is updated.


Looking to a real environment, the same toolchain can be installed on
different places.

To make cmake have advantage, for every installation ( where ever a user
may choose to install  ) i have to create personalized file, so a lot of
almost same files for one cross compile tool has to be created.

I think it has a big advantage if the COMPILER_PATH CROSS_COMPILER values
could be set when invoking cmake and move the cross-compile stuff into the
CMakeFiles.


I have no insight in the design of cmake, just in the code , if it is
available i'm willing to see how this can be added to cmake.


I hope cmake team is willing to have look to this. and give some feedback.


Kind regards,

Wim.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140326/0c162d6c/attachment.html>


More information about the CMake mailing list