[CMake] codesourcery integration

Andrea Galeazzi Galeazzi at korg.it
Wed Nov 17 12:32:07 EST 2010


I'm facing the problem of using the cross compile toolchain of 
CodeSourcery. My host system in Windows and my target is ARM-Linux.
I red this tutorial http://www.cmake.org/Wiki/CMake_Cross_Compiling and 
I tried to do something similar:
# this one is important
SET(CMAKE_SYSTEM_NAME Linux)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)

# specify the cross compiler
SET(CMAKE_C_COMPILER   C:/Programmi/CodeSourcery/Sourcery G++ 
Lite/bin/arm-none-linux-gnueabi-gcc.exe)
SET(CMAKE_CXX_COMPILER C:/Programmi/CodeSourcery/Sourcery G++ 
Lite/bin/arm-none-linux-gnueabi-g++.exe)

# where is the target environment
SET(CMAKE_FIND_ROOT_PATH C:/Programmi/CodeSourcery/Sourcery G++ Lite)

# 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)

but when I try to configure a msys makefile I've got

The C compiler identification is GNU
The CXX compiler identification is GNU
CMake Error at C:/Programmi/CMake 
2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:35 
(GET_FILENAME_COMPONENT):
  get_filename_component unknown component G++
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


Check for working C compiler: 
C:/Programmi/CodeSourcery/Sourcery;G++;Lite/bin/arm-none-linux-gnueabi-gcc.exe
CMake Error at C:/Programmi/CMake 
2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:35 
(GET_FILENAME_COMPONENT):
  get_filename_component unknown component G++
Call Stack (most recent call first):
  CMakeLists.txt:2 (PROJECT)


CMake Error: your C compiler: 
"C:/Programmi/CodeSourcery/Sourcery;G++;Lite/bin/arm-none-linux-gnueabi-gcc.exe" 
was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or 
name.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
Check for working C compiler: 
C:/Programmi/CodeSourcery/Sourcery;G++;Lite/bin/arm-none-linux-gnueabi-gcc.exe 
-- broken
CMake Error at C:/Programmi/CMake 
2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler
  
"C:/Programmi/CodeSourcery/Sourcery;G++;Lite/bin/arm-none-linux-gnueabi-gcc.exe"
  is not able to compile a simple test program.

  It fails with the following output:

 
  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


CMake Error: your C compiler: 
"C:/Programmi/CodeSourcery/Sourcery;G++;Lite/bin/arm-none-linux-gnueabi-gcc.exe" 
was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or 
name.
CMake Error: your CXX compiler: 
"C:/Programmi/CodeSourcery/Sourcery;G++;Lite/bin/arm-none-linux-gnueabi-g++.exe" 
was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path 
or name.
Configuring incomplete, errors occurred!

What's wrong?
Furthermore if I want to use Eclipse, what kind of Eclipse makefile 
should I choose?


More information about the CMake mailing list