[CMake] WinCE Support

Clemens Arth clemens.arth at gmx.at
Wed Apr 15 03:45:24 EDT 2009


Hi,

well, I have not tested it with the Express versions of 2005 or 2008 (I 
think Microsoft already stopped support of Express 2005, so there is 
only Express 2008 left). I will try to get it to run with an Express 
Version of 2008, although I have no idea of support for Windows Mobile 
devices in this version. If there is no support, then the generators 
will clearly only work for the commercial versions.

In principle the generators will produce all possible configuration 
targets (times all default configs, like minrel, minsize, debug and 
release) as long as you omit the SDK entry in the cache file (to be 
copied prior to running configure). However, this is quite a bad 
solution originating from the beginnings of writing the patch as a 
fallback solution, and one should use the generator in a different way; 
by now I did not think about building a project for multiple different 
target machines in one configuration/build step, and I guess also in 
your CMakeLists.txt you might have to include different configuration 
sections for different machine types, e.g. one for ARM and one for SH4 
which complicates the entire process. If your settings are so different 
that you nearly have to use two different toolchain files, it might be 
quite a bad idea to build only one single project.

I cannot try anything else than the WinCE or Windows Mobile SDKs for ARM 
here because I have no SH4 machines, but configuring a project for other 
platforms should basically work the same way. Clearly, in case you want 
to really run it with different cross-compile settings (like to compile 
it for SH4 with SH4 settings and to compile it for ARM with ARM 
settings) I think you should simply pre-configure the cache file to 
build the project for this platform only, and then repeat the process 
for any other platform. In principle, the cache file sets the toolchain 
file and - at the same time - adds the missing capability to choose the 
right SDKs. In one case you would preconfigure the cache file to use a 
toolchain file containing all the SH4 settings, and another toolchain 
file to set all ARM specific settings. If you use a common toolchain 
file like yours WinCE one, you just choose the SDK to use and set some 
flag like CONFIG_IS_SH4 or CONFIG_IS_ARM and you get the correct 
configuration in Visual Studio and choose the correct configuration 
section from your CMakeLists.txt file.

In my case for example, I build it for Win32 and Windows Mobile 5 in 
separate directories which works great. If you install an SH4 SDK and an 
ARM SDK, preconfigure the cache files and configure/build in separate 
directories with different settings it should work almost the same.

Clemens

Andreas Pokorny schrieb:
> 2009/4/14 Andreas Pokorny <andreas.pokorny at gmail.com>:
>   
>> [...]
>>
>> Configuring our project fails during the CMakeTestCCompiler.cmake
>> tests, because it tries to execute the generated project files with
>> VCExpress wich has no SDK configured - and I doubt that it supports
>> multiple SDKs at all. I am investigating that right now.
>>     
>
> Changing the order in which CMakeVS8FindMake and VS9 respectively,
> search for devenv and VCExpress fixed the issue.
>
> Before I stopped for today I also discovered that there is a way to
> magically set the UNDER_CE macro depending on the SDK used. For NMake
> Makefiles I did that depending on the given CMAKE_SYSTEM_VERSION. I
> will try to add that tomorrow.
>
> As far as I understand, with the new generators for 2005 and 2008,
> cmake will create project files for multiple cross compilation targets
> at once? So if one has a SH4 and a ARMV4 CE SDK installed, we would
> get a visual studio project that can be switched between these two
> configurations (times the release/debug configurations), but there
> would be only a single execution of the CMakeLists.txts with a
> probably invalid set of CMAKE_SYSTEM_* variables. So if a project for
> example modifies the set of source files for a target, or sets its own
> set of platform describing cmake variables based on the given CMAKE_*
> variables, we would break that project when the new generators are
> used?
>
> kind regards,
> Andreas Pokorny
>
>   



More information about the CMake mailing list