[CMake] Visual Studio and Windows Mobile SDKs

Clemens Arth Clemens.Arth at gmx.at
Wed Jul 9 08:50:25 EDT 2008


-------- Original-Nachricht --------
> Datum: Tue, 8 Jul 2008 23:48:58 +0200
> Von: Alexander Neundorf <a.neundorf-work at gmx.net>
> An: "Clemens Arth" <Clemens.Arth at gmx.at>
> CC: cmake at cmake.org
> Betreff: Re: [CMake] Visual Studio and Windows Mobile SDKs

> 
> On Monday 07 July 2008, you wrote:
> > Hi,
> >
> > I'll submit a patch as soon as I've managed to work around some
> remaining
> > issues. After messing around with some registry stuff, here's where I'm
> > currently standing. I had a hard time to find whether VS stores the
> > information on all the different SDKs in the registry or in a file.
> > Concerning Windows Mobile they are stored in a config file called
> > ${VSHOME}\VC\vcpackages\WCE.VCPlatform.config. Now I'm using a special
> XML
> > parser engine derived from cmXMLParser to parse it and to get a vector
> of
> > structs containing all the information, including the used instruction
> set,
> > the exact SDK name, etc. I also removed the need for the additional
> command
> > line flags. All the toolchain-based stuff moved into the generator,
> because
> > the only important flag to set is the "WINCE" flag to access the
> platform
> > specific files. Everything else can also be parsed from the SDK
> > definitions. Also the compilers/assemblers are set in the generator
> itself,
> > because basically it is just a change of executables within VS (because
> > they are part of VS anyway). 
> 
> Does this actually influence the makefile generators in any way or is
> there 
> information which could/should also be used by them ?

Well, concerning nmake or gmake Makefiles I'm not sure about that because I do not use them. 

> 
> > Now I end up having a generator with a set of
> > SDKs and, unfortunately, only one possibility to set
> "this->PlatformName"
> > to one of the SDKs. 
> 
> Could this be done by setting a special cmake variable in the toolchain
> file 
> (which is read very early) and which could then be evaluated by the 
> generator ?

The Visual Studio generators always default to "x64" or "Win32"; one way to pass that would be the introduction of a "cmGlobalVisualStudioXCustomGenerator", which can parse a cmake variable to set the platform name. This cmake variable can maybe set or chosen according to the available SDKs in the config file. I don't know if it is possible to parse an xml file directly in the cmake environment, but if it is, then one can think about turning it on and off automatically. Then it would be possible to use a toolchain file, together with this special cmake variable to set the correct platform. However, the lack of defining multiple platforms at a time remains, because then you can still only define a single platform at a time. A way around that would be to call cmake with multiple different toolchain files, always using another platform name from the pool of available SDKs. Then you can also pass different flags and compiler settings to all of them (see problem described below). A drawback is that 1) you have to call it multiple times, and 2) that you end up with x Visual Studio solutions with x being the number of SDKs.

Attached you can find the patch files for my current version. I added some additional loops in the generators to create projects for all SDKs installed. I added a version for windows mobile as VS 2005 and one for 2008, but I only tested the latter one. One might simply select it in the drop-down menu in the Cmake GUI. Because the settings in the CMakeLists.txt file can only be defined once, there is one remaining problem: after generating the solution and vjproj files, all platforms end up with this same configuration. However, as long as the SDKs work with the same flags, that's perfectly fine. Nevertheless, for example in my case, the flags are tuned to work with "Pocket PC 2005 SDK", but they do not work with the "Smartphone 2003" stuff. I do not bother, because I do not use it right now, but this is still something that has to be tackled somehow in the future.

I'd really appreciate if someone could verify the changes and comment on the ideas described in the paragraph above.

Regards
Clemens

> 
> Alex
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake

-- 
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmake_patch_files.zip
Type: application/x-zip-compressed
Size: 22606 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080709/e7a33f38/attachment-0001.bin>


More information about the CMake mailing list