[CMake] Updated WinCE CMakefiles

Clemens Arth clemens.arth at gmx.at
Fri Oct 10 02:58:23 EDT 2008


Andreas,

sorry but it took me a little longer to get the diff done, but now I
included some more things I found useful. Currently everything runs fine
for PPC2003,SP2003,WM5,WM6, and CE5.0, based on your configuration and
some additional flags set - basically it's all in there what we (or at
least I) wanted :-)

For enthusiastic users of cmake and Visual Studio like me, there are
some suggestions I'd make for future versions of the generators which I
found to be reasonable. Some of them I have already changed in the
patched version.

First I came across the settings for program optimization. There are
multiple settings, one for the compiler (/GL), one for the linker
(/LTCG), and finally a global flag to be enabled for the configuration
(WholeProgramOptimization="X"). While the compiler and the linker flags
can be set in the project, there is no option to enable the optimization
in the project file (maybe leading to the linker complaining about a
useless /LTCG flag, which is ignored if this global optimization flag is
not set). This means that there should also be some type of flag like
CMAKE_MFC_FLAG to enable to control this optimization from outside (ie.
the CMakeLists.txt project file).

The second issue is related to the way flags are handled in the current
versions of the generators. There is one FlagTable for the VS7 and
ExtraFlagTables for VS8 and VS9 for controlling the compiler flags.
That's totally fine. There is also a LinkFlagTable for VS7, but this one
is not extended by ExtraLinkFlagTables for VS8 and VS9. This is also the
reason why some of the flags passed from the project file are not
translated automatically into settings in the project file, but are only
passed as additional link options. I'd suggest introducing this
ExtraLinkFlagTables, which I already introduced in my version and which
help me controlling the build in my patched version for using platform
SDKs. This causes almost no overhead, but allows for a more granular way
of controlling the compiler and linker settings.

The last issue is the way to pass compile options for building a library
or executable. While there are settings passed to the linker by
LINK_FLAGS_{configname} scheme using SET_TARGET_PROPERTIES, there is no
such operation for COMPILE_FLAGS which can only be set for all
configurations to be the same. This is really a mess, because one is
forced to alter the CMAKE_C{XX}_FLAGS_{configname} variables by misusing
SET, REGEX REPLACE kind of stuff, which on the one hand makes things
quite complicated on the project file level, on the other hand might
break completely for some pathological cases. What about introducting
the COMPILE_FLAGS_{configname} scheme for SET_TARGET_PROPERTIES?

Please review!

kind regards
Clemens

Andreas Pokorny wrote:
> Hello Clemens,
>
> 2008/9/30 Clemens Arth <clemens.arth at gmx.at>:
>   
>> [...] I further modified your WinCE.cmake(-cl) configuration to
>> WM5.cmake(-cl) to contain additional flags needed. Also a cached variable
>> PLATFORM_SDKS is used that selects only those platforms from the set of all
>> platforms installed. This works pretty well, as one simply has to create
>> this cache file first, and the rest works as expected.[...]
>>     
>
> Shall we treat Windows Mobile and Windows CE as different operating systems?
> What are the differences in this case? I found that info on the entry point:
> http://msdn.microsoft.com/en-us/library/aa934487.aspx
>
> There seem to be countless variants of WinCE. I recently heard about
> Windows CE Auto
> and Windows CE Automotive. CE seems to be constantly moving target.
>
> kind regards
> Andreas
>
>   




More information about the CMake mailing list