[cmake-developers] VS 2013 WindowsCE support
Bach, Pascal
pascal.bach at siemens.com
Wed Sep 3 05:23:28 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}")
Do we need to preserve the current behavior?
CMAKE_VS_WINCE_VERSION seems to be undocumented.
The new way would be to set CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_VERSION in a toolchain file.
>
> 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.
So do you agree that the right thing would be to add a CMAKE_VS_PLATFORM_SDK (or CMAKE_GENERATOR_SDK ?) variable that the user can set?
A resulting toolchain file would look something like this:
set(CMAKE_SYSTEM_NAME "WindowsCE")
set(CMAKE_SYSTEM_VERSION "8.0")
set(CMAKE_SYSTEM_PROCESSOR "arm" )
set(CMAKE_GENERATOR_TOOLSET "CE800") # I still don't know if this is needed ;)
set(CMAKE_GENERATOR_SDK "MYSDK01")
I don't understand the purpose of CMAKE_GENERATOR_TOOLSET resp. CMAKE_VS_PLATFORM_TOOLSET.
As far as I understand they are independent of the SDK selected?
>
> >> 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.
>
Thanks I will have a look there.
Pascal
More information about the cmake-developers
mailing list