summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-08-16 20:20:34 (GMT)
committerBrad King <brad.king@kitware.com>2012-08-22 20:35:46 (GMT)
commit89595d6bceb25ecfa221342f03d1c3dce70c8484 (patch)
tree45077939932707b7bd7a6a91d8031b6f0e30e72a
parent965a69dcaa0b67c730f45487abeee97ef652d545 (diff)
downloadCMake-89595d6bceb25ecfa221342f03d1c3dce70c8484.zip
CMake-89595d6bceb25ecfa221342f03d1c3dce70c8484.tar.gz
CMake-89595d6bceb25ecfa221342f03d1c3dce70c8484.tar.bz2
VS10: Define CMAKE_VS_PLATFORM_TOOLSET variable
When the VS 10 generator selects a non-default PlatformToolset to specify for MSBuild, report the selected name in this variable.
-rw-r--r--Source/cmDocumentVariables.cxx10
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx11
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h1
3 files changed, 22 insertions, 0 deletions
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index 05ef8fc..376b947 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -283,6 +283,16 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"see CMAKE_BUILD_TOOL.",false,
"Variables that Provide Information");
cm->DefineProperty
+ ("CMAKE_VS_PLATFORM_TOOLSET", cmProperty::VARIABLE,
+ "Visual Studio Platform Toolset name.",
+ "VS 10 and above use MSBuild under the hood and support multiple "
+ "compiler toolchains. "
+ "CMake may specify a toolset explicitly, such as \"v110\" for "
+ "VS 11 or \"Windows7.1SDK\" for 64-bit support in VS 10 Express. "
+ "CMake provides the name of the chosen toolset in this variable."
+ ,false,
+ "Variables that Provide Information");
+ cm->DefineProperty
("CMAKE_MINOR_VERSION", cmProperty::VARIABLE,
"The Minor version of cmake (i.e. the 4 in X.4.X).",
"This specifies the minor version of the CMake"
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index b44b780..39c9ae1 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -28,6 +28,17 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator()
}
//----------------------------------------------------------------------------
+void cmGlobalVisualStudio10Generator::AddPlatformDefinitions(cmMakefile* mf)
+{
+ cmGlobalVisualStudio8Generator::AddPlatformDefinitions(mf);
+ if(!this->PlatformToolset.empty())
+ {
+ mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET",
+ this->PlatformToolset.c_str());
+ }
+}
+
+//----------------------------------------------------------------------------
void cmGlobalVisualStudio10Generator::WriteSLNHeader(std::ostream& fout)
{
fout << "Microsoft Visual Studio Solution File, Format Version 11.00\n";
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index a4a9d40..47ce790 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -38,6 +38,7 @@ public:
virtual const char* GetName() const {
return cmGlobalVisualStudio10Generator::GetActualName();}
static const char* GetActualName() {return "Visual Studio 10";}
+ virtual void AddPlatformDefinitions(cmMakefile* mf);
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry) const;