[CMake] CMake-2.6 CMAKE_TOOLCHAIN_FILE

Andreas Pokorny andreas.pokorny at gmail.com
Tue May 13 05:45:06 EDT 2008


Hi,
Can you give me some hints on filtering the strace output. I expected
to find syscalls
that try to open "ar" or "ar.exe". There was none.

I looked at calls of "symlink_info::check". When grepping for these
calls, there was a
block of:
38 4093345 [main] cmake 528 symlink_info::check: 0 = symlink.check (c:\work\Q
NX632\host\win32\x86\usr\bin\objdump.exe, 0x22A7F0) (0x0)
with simlar calls for nm strip ld objcopy and objdump.
C:\work\QNX632\usr\bin matches:
${QNX_HOST_WIN_PATH}/usr/bin/

I found no sign of arm-unknown-nto-qnx6.3.0-ar.exe or even ar.exe
(which does not exist
in that directory, only several ar binaries with the paltform prefix exist).

As a workaround I could change the variable CMAKE_CXX_CREATE_STATIC_LIBRARY
and hardcode the filepath to ar there.

kind regards
Andreas Pokorny

2008/5/9 Alexander Neundorf <a.neundorf-work at gmx.net>:
>
> 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