[CMake] cmake 2.5 with windows mobile

Alexander Neundorf a.neundorf-work at gmx.net
Fri Aug 31 12:50:47 EDT 2007


On Friday 31 August 2007 12:12, Artur Wisz wrote:
> Hello dear CMake Users and Maintainers,
>
> we would like to use CMake in our project, but one of the required
> platform is Windows Mobile 5.0. Unfortunately, CMake does not support
> this platform "out of the box". I know CMake supports cross-compiling
> now and is extensible, so I want to devote some time and try to write
> additional platform modules. However, I am sure some guidance from the
> CMake developers would save me lots of time. I will describe what I did
> to make a simple Makefile for nmake.
> I am using the Visual Studio 2005 and the Windows Mobile 5 SDK
> integrates with it.
> Normally I have to run the vcvarsall.bat or use the VS 2005 Command
> Prompt. Before running nmake, I have to set some environment variables:
>
> set PATH=c:\Program files\Microsoft Visual Studio
> 8\VC\ce\bin\x86_arm\;%PATH%
> set INCLUDE=C:\Program files\Windows CE Tools\wce500\Windows Mobile 5.0
> Pocket PC SDK\Include\Armv4i;C:\Program files\Microsoft Visual Studio
> 8\VC\ce\atlmfc\include;C:\Program files\Microsoft Visual Studio
> 8\VC\ce\include
> set LIB=C:\Program files\Microsoft Visual Studio
> 8\VC\ce\lib\armv4i;C:\Program files\Windows CE Tools\wce500\Windows
> Mobile 5.0 Pocket PC SDK\Lib\ARMV4I
>
> After this I can run nmake. A sample working makefile for a Debug build
> is given below.
>
> There are 3 processor architectures supported: arm, mips, sh, which
> translate to VC\ce\bin subdirectories: x86_arm, x86_mips, x86_sh; but at
> the moment ARM is the one we are using.
>
> I tried to hook up a custom platform file for cmake, but once the VS
> Command Prompt is used, it always wants to detect the compiler by
> building CMakeCCompilerId.c and running it, which fails, as it is a
> cross-compilation. 

Why is this failing ?
It only tries to build an executable, it doesn't run it.

Is the compiler called cl.exe or clarm.exe ?

You need to setup a "toolchain file" as described here:
http://www.cmake.org/Wiki/CMake_Cross_Compiling

It should contain
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_C_COMPILER ...)
SET(CMAKE_CXX_COMPILER ...)

This should be enough to get you over the first steps so a hello world can be 
built.

Windows-cl.cmake assumes that cl is the native compiler and so can be only x86 
32bit or x86 64bit.
Either this file has to be modified or a new platform "WindowsMobile" is 
required. Is Windows Mobile a slimmed down version of XP or is it based on 
Win CE ?

Bye
Alex


More information about the CMake mailing list