CMake

CMake got cross-compiling support in version 2.6. Note that CMake currently can't build ARM and x86 binaries at the same time, so anything that needs a bootstrapped tool needs to be compiled twice, once for x86 and once for ARM.

include(CMakeForceCompiler)set(CMAKE_SYSTEM_NAMELinux)# set this to wherever MADDE isset(MADDE_HOME$ENV{HOME}/.madde/0.6.14/targets/fremantle-qt-0951)CMAKE_FORCE_C_COMPILER(${MADDE_HOME}/bin/gccGNU)CMAKE_FORCE_CXX_COMPILER(${MADDE_HOME}/bin/g++GNU)set(CMAKE_FIND_ROOT_PATH${MADDE_HOME})set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAMNEVER)set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARYONLY)set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDEONLY)

Unfortunately, current CMake 2.6 likes to use absolute paths. This won't work well with MADDE, which evaluates absolute paths relative to its sysroot directory. The -DCMAKE_USE_RELATIVE_PATHS=ON CMake flag could help, but seems to have some issues. In the meantime, we use a small hack, by symlinking our home directory into MADDEs sysroot, so all pathes within the MADDE environment will match the ones on our home system: