[cmake-developers] Specifying VS target platform (was: Added very basic Windows CE Makefile support)

Brad King brad.king at kitware.com
Thu Sep 13 08:21:52 EDT 2012


On 09/13/2012 08:06 AM, Patrick Gansterer wrote:
> If you apply it to the other VS genertors we need to extend the list
> of generators with every SDK found (-G "Visual Studio 8 2005
> ${CMAKE_WINCE_SDK}"). IMHO selecting the platform for the VS
> compiler with different compilers isn't perfect either (For every
> new VS version you get 2 (with ARM 3) new generator types).  Maybe
> we can extend the "-G parameter" with something like "-GP
> generatorPlatform" and remove the "Win64" and "ARM" VS generators?

I've never been happy with the platform-in-generator-name approach
either.  It was first done for VS 2005 and only added one extra
generator name at the time.  We need to come up with another approach.
We just need to honor the currently enumerated names for backward
compatibility though.

Since VS 2010 the vcxproj files can specify the toolchain to use
independent of the VS version (to use the VS 9 tools with VS 10
for example).  Recently the 'ide-compiler-id' topic was merged.
With that we should be able to support changing the toolchain
for VS 2010 and above, but we need to choose an interface to set
it.  Since toolchains come with SDKs this should be the same
interface needed to specify the WinCE SDK.

We need an interface both on the command line and in the cmake-gui.
An option like your proposed "-GP" should work well for the command
line, through I'd like to think about the name a bit more.  In the
IDE there is a dialog that comes up to configure the toolchain
for other generators in a fresh build tree.  That should be taught
to select the toolset to use for VS.

>> Please also add documentation for CMAKE_WINCE_SDK.
>>
>> BTW, why is this hunk needed?
>>
>> +  this->GetCMakeInstance()->AddCacheEntry("CMAKE_C_COMPILER",
>> +    "cl", "", cmCacheManager::INTERNAL);
>> +  this->GetCMakeInstance()->AddCacheEntry("CMAKE_CXX_COMPILER",
>> +    "cl", "", cmCacheManager::INTERNAL);
> 
> Otherwiese Visual Studio catches the wrong compiler later.
> But maybe the CMake codebase improved in the meantime (the patch is based on v2.8.3).

The above-mentioned 'ide-compiler-id' topic re-works the way these
variables get set in the VS IDE generators.  Your branch is now
based on a version with that topic so please investigate it again.

Thanks,
-Brad


More information about the cmake-developers mailing list