CMake: Add CMAKE_GENERATOR_PLATFORM option

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_PLATFORM and associated variable documentation to
hold the value persistently.

Add a RunCMake.GeneratorPlatform test to cover basic use cases for the
option.  Verify that CMAKE_GENERATOR_PLATFORM is empty by default, and
that it is rejected when the generator does not support a user setting.
This commit is contained in:
Brad King
2014-09-05 14:25:27 -04:00
parent 4f7d0c421a
commit 0f1f1271e6
16 changed files with 120 additions and 0 deletions
@@ -0,0 +1,13 @@
CMAKE_GENERATOR_PLATFORM
------------------------
Generator-specific target platform name specified by user.
Some CMake generators support a target platform name to be given
to the native build system to choose a compiler toolchain.
The value of this variable should never be modified by project code.
A toolchain file specified by the :variable:`CMAKE_TOOLCHAIN_FILE`
variable may initialize ``CMAKE_GENERATOR_PLATFORM``. Once a given
build tree has been initialized with a particular value for this
variable, changing the value has undefined behavior.