[CMake] CMake-2.6 CMAKE_TOOLCHAIN_FILE

Alexander Neundorf a.neundorf-work at gmx.net
Fri May 9 16:13:23 EDT 2008


On Friday 09 May 2008, Andreas Pokorny wrote:
> Hello,
> I currently try to replace my cmake-2.4 cross compile workarounds with
> proper cmake-2.6 toolchain files.
> The first one I tried was my ARM QNX Neutrino 6.3 file:
>
> ########################
> SET(CMAKE_SYSTEM_NAME QNX)
> SET(CMAKE_SYSTEM_VERSION 6.3)
>
> SET(QNX_TARGET $ENV{QNX_TARGET} CACHE PATH "Path to QNX Target env")
> SET(QNX_HOST $ENV{QNX_HOST} CACHE PATH "Path to QNX host tool chain")
>
> ## This one looks ugly -- the env vars above have to be correct unix
> paths, that means on cygwin
> ## we need to set /cygdrive/c/work/qnx/, otherwise gcc will not find
> any headers or libraries or
> ## even "ld".
> ## When executing the Native Win32 CMake then the cygwin path will not
> work for cmake, i believe.
> ## Hence we try to replace /cygdrive with a Windows drive letter...
> STRING(REGEX REPLACE "/cygdrive/\(.\)" "\\1:" QNX_HOST_WIN_PATH
> ${QNX_HOST}) STRING(REGEX REPLACE "/cygdrive/\(.\)" "\\1:"
> QNX_TARGET_WIN_PATH ${QNX_HOST})
>
> MESSAGE(STATUS "Compiling for QNX 6.3 ARM")
>
> SET(CMAKE_CXX_COMPILER
> "${QNX_HOST_WIN_PATH}/usr/bin/arm-unknown-nto-qnx6.3.0-gcc.exe")
> SET(CMAKE_C_COMPILER
> "${QNX_HOST_WIN_PATH}/usr/bin/arm-unknown-nto-qnx6.3.0-gcc.exe")
> SET(CMAKE_AR
> "${QNX_HOST_WIN_PATH}/usr/bin/arm-unknown-nto-qnx6.3.0-ar.exe")
> SET(CMAKE_RANLIB
> "${QNX_HOST_WIN_PATH}/usr/bin/arm-unknown-nto-qnx6.3.0-ranlib.exe")
>
> SET(CMAKE_FIND_ROOT_PATH ${QNX_HOST_WIN_PATH} ${QNX_TARGET_WIN_PATH})
> set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
> set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
> set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
> ######################## EOF
>
> Now when running with the "Unix Makefile" generator the CMAKE_AR seems
> to be empty or undefined.
> The shell complains that "cr" cannot be found, cr as in <CMAKE_AR> cr
> LIB OBJECTS.
>
> Any ideas what is wrong here?

Can you run it in strace or something similar so you can check what and where 
it searches ?

Alex


More information about the CMake mailing list