CMake: Add -T option to choose a generator toolset

Reject the option by default.  It will be implemented on a per-generator
basis.  Pass the setting into try_compile project generation.  Add cache
entry CMAKE_GENERATOR_TOOLSET and associated variable documentation to
hold the value persistently.

Add a RunCMake.GeneratorToolset test to cover basic "-T" option cases.
Verify that CMAKE_GENERATOR_TOOLSET is empty without -T, that -T is
rejected when the generator doesn't support it, and that two -T options
are always rejected.
This commit is contained in:
Brad King
2012-12-10 10:42:33 -05:00
parent 118c32f8f2
commit 4fd5342956
19 changed files with 141 additions and 0 deletions
+8
View File
@@ -254,6 +254,14 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"for the respective IDE. This IDE project file generator is stored in "
"CMAKE_EXTRA_GENERATOR (e.g. \"Eclipse CDT4\").",false,
"Variables that Provide Information");
cm->DefineProperty
("CMAKE_GENERATOR_TOOLSET", cmProperty::VARIABLE,
"Native build system toolset name specified by user.",
"Some CMake generators support a toolset name to be given to the "
"native build system to choose a compiler. "
"If the user specifies a toolset name (e.g. via the cmake -T option) "
"the value will be available in this variable.",false,
"Variables that Provide Information");
cm->DefineProperty
("CMAKE_HOME_DIRECTORY", cmProperty::VARIABLE,
"Path to top of source tree.",