CMake/Tests/RunCMake/GeneratorPlatform/NoPlatform.cmake
Brad King 0f1f1271e6 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.
2014-09-05 14:38:05 -04:00

8 lines
252 B
CMake

if("x${CMAKE_GENERATOR_PLATFORM}" STREQUAL "x")
message(FATAL_ERROR "CMAKE_GENERATOR_PLATFORM is empty as expected.")
else()
message(FATAL_ERROR
"CMAKE_GENERATOR_PLATFORM is \"${CMAKE_GENERATOR_PLATFORM}\" "
"but should be empty!")
endif()