[cmake-developers] [PATCH] WINCE, VS: Allow selecting an SDK for Windows CE on Visual Studio

Bach, Pascal pascal.bach at siemens.com
Fri Sep 5 10:02:58 EDT 2014


 
> On 09/05/2014 09:16 AM, Bach, Pascal wrote:
> > I'm not clear what you mean.
> > As far as I understand the solution files that do try compile
> > are generated using the same generator that generates the
> > final solution file.
> 
> A generator with the same name is used but it is not the same
> instance of cmGlobalGenerator.  See cmMakefile::TryCompile:
> 
> 
> http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmMakefile.c
> xx;hb=v3.0.1#l3080
> 
> It creates a new generator, but also does cm.SetIsInTryCompile(true)
> on the temporary try_compile cmake instance.  That tells the
> generator's EnableLanguage method to load settings for languages
> from the existing files created by the outer generator.
> 
> The try_compile generator is explicitly given the toolset:
> 
>  cm.SetGeneratorToolset(this->GetCMakeInstance()-
> >GetGeneratorToolset());
> 
> but the rest of the information (e.g. CMAKE_SYSTEM_NAME) gets
> loaded from CMakeFiles/<cm-version>/CMakeSystem.cmake and a few
> per-language files.  The CMAKE_VS_WINCE_SDK value (or whatever more
> general name we choose) will have to go through here too.

Ok now I understand.

> Since CMakeSystem.cmake loads the CMAKE_TOOLCHAIN_FILE, try_compile
> should use CMAKE_VS_WINCE_SDK when the value is set in the toolchain
> file.  Is this the case when you test the changes locally?
> 

The case I was testing was indeed with the CMAKE_VS_WINCE_SDK set inside the toolchain file.
I guess to support this variable only in the toolchain file is not an option?

Pascal



More information about the cmake-developers mailing list