[CMake] Cross-compiling a static library (CMake 2.8.3)

Emmanuel Blot eblot.ml at gmail.com
Mon Feb 7 17:44:44 EST 2011


>> FWIW: I found why I use CMAKE_FORCE_C_COMPILER rather than the simpler
>> CMAKE_C_COMPILER command:
>> I build projects for eCos from outside the eCos tree directory, and
>> CMake has some trouble finding the eCos header files when simply using
>> CMAKE_C_COMPILER. It complains about CMAKE_FIND_ROOT_PATH which is
>> nevertheless defined as expected.

Sorry to get back so late on this topic

> You should not need to use CMAKE_FORCE_C_COMPILER() for eCos.
> Can you please post some more details on your setup ?

I build eCos-based projects for ARM. The compiler prefix is "arm-eabi-"

The basic directory layout is as follows:

ecos/ : contains the std eCos "packages" subdir, etc.
sdk/  : contains our base code, that builds against eCos

build/ : where all the code is built (out-of-source build), that is:
  build/ecos_build
  build/ecos_install
  build/sdk ...

> Where is the eCos tree with libtarget.a etc. ?
  build/ecos_install/lib/libtarget.a
  build/ecos_install/include/pkgconf/system.h

> How does your toolchain file look like ?
arm-eabi-gcc-4.5.2 (on Linux, Mac OS X), arm-eabi-gcc-4.5.2.exe (on Cygwin)
all other toolchain tools are prefixed with arm-eabi- as well

> How do you call cmake ?



More information about the CMake mailing list