[cmake-developers] VS 2013 WindowsCE support

Brad King brad.king at kitware.com
Tue Sep 2 12:02:53 EDT 2014


On 09/02/2014 11:27 AM, Bach, Pascal wrote:
>> we should now be able to activate cross-compiling
>> with -DCMAKE_SYSTEM_NAME=WindowsCE or -
>> DCMAKE_TOOLCHAIN_FILE=...
>> while still using -G "Visual Studio 12 2013" as the generator.
>
> I think proposal would make things cleaner.

Great.  It should be able to work for VS 2010 and greater.

> I think specifying only -DCMAKE_SYSTEM_NAME=WindowsCE wouldn't be
> enough or how does VS know what compiler to use?

Correct.  We would need another variable to specify the SDK.
It could be added to the command line or set in a toolchain file.

> I would like it if we had a toolchain file for each SDK but
> then I'm not clear what it contains. In this toolchain file do
> we specify compiler etc like it is done for gcc for example,
> or would the toolchain file contain a variable like CMAKE_VS_SDK
> pointing to one of the installed SDKs?

The following block in Modules/CMakeDetermineSystem.cmake:

 elseif(CMAKE_VS_WINCE_VERSION)
   set(CMAKE_SYSTEM_NAME      "WindowsCE")
   set(CMAKE_SYSTEM_VERSION   "${CMAKE_VS_WINCE_VERSION}")
   set(CMAKE_SYSTEM_PROCESSOR "${MSVC_C_ARCHITECTURE_ID}")

is basically a mini toolchain file.  A real toolchain file would
explicitly specify the values.  We would also need a new variable
to tell the generator which SDK to use.  Currently the info is
in the internal CMAKE_VS_PLATFORM_NAME variable that corresponds
to the platform component of the generator name.

>> I can help guide anyone interested in making the needed changes.
>
> I might be able to invest some time into this so some guidance
> would be welcome ;)

Take a look at cmGlobalVisualStudio10Generator::InitializeSystem
in recent 'master' versions.  That is likely the place to hook
in to recognize the "WindowsCE" name and look up the SDK variable.

-Brad




More information about the cmake-developers mailing list