summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-12-10 15:52:10 (GMT)
committerBrad King <brad.king@kitware.com>2013-02-07 16:06:28 (GMT)
commit650c6471600fa8b06ed343ff3a4f3d16a3dc95bc (patch)
treeacb198ff664687a5cfad1fa238d46a9c80e74570 /Source
parent4fd534295642b1c08c72229d705db6c7265ecd28 (diff)
downloadCMake-650c6471600fa8b06ed343ff3a4f3d16a3dc95bc.zip
CMake-650c6471600fa8b06ed343ff3a4f3d16a3dc95bc.tar.gz
CMake-650c6471600fa8b06ed343ff3a4f3d16a3dc95bc.tar.bz2
VS: Implement generator toolset selection (#10722, #13774)
Implement generator toolset selection (cmake -T) for VS >= 10 by setting the PlatformToolset. Extend the RunCMake.GeneratorToolset test case to verify CMAKE_GENERATOR_TOOLSET when the generator supports -T. Since commit 485a940e (VS: Simplify MSVC version reporting, 2012-08-23) all MSVC version information is detected during the compiler id step from the actual compiler invoked by generated build systems rather than hard-coded in VS generators. Therefore we can set the PlatformToolset in VS >= 10 project files and support toolsets from other VS versions.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx8
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h2
-rw-r--r--Source/cmake.h2
3 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index d992036..cac72fc 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -80,6 +80,14 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator(
}
//----------------------------------------------------------------------------
+bool
+cmGlobalVisualStudio10Generator::SetGeneratorToolset(std::string const& ts)
+{
+ this->PlatformToolset = ts;
+ return true;
+}
+
+//----------------------------------------------------------------------------
void cmGlobalVisualStudio10Generator::AddPlatformDefinitions(cmMakefile* mf)
{
cmGlobalVisualStudio8Generator::AddPlatformDefinitions(mf);
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index b377a20..5926e0f 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -28,6 +28,8 @@ public:
const char* architectureId, const char* additionalPlatformDefinition);
static cmGlobalGeneratorFactory* NewFactory();
+ virtual bool SetGeneratorToolset(std::string const& ts);
+
virtual std::string
GenerateBuildCommand(const char* makeProgram,
const char *projectName,
diff --git a/Source/cmake.h b/Source/cmake.h
index 7253b39..dd0eb6b 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -540,6 +540,8 @@ private:
{"-T <toolset-name>", "Specify toolset name if supported by generator.", \
"Some CMake generators support a toolset name to be given to the " \
"native build system to choose a compiler. " \
+ "This is supported only on specific generators:\n" \
+ " Visual Studio >= 10\n" \
"See native build system documentation for allowed toolset names."}, \
{"-Wno-dev", "Suppress developer warnings.",\
"Suppress warnings that are meant for the author"\