summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-09-12 14:38:54 (GMT)
committerBrad King <brad.king@kitware.com>2014-09-15 14:27:00 (GMT)
commitbe6a555d7ec9348575e3431bd6709f48dc959100 (patch)
tree698b444cd0fc952ff986852f8b657c71ac1b0a99 /Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain.cmake
parentd506fee81ca8fca7fe0c91da4bd4a3551d210b06 (diff)
downloadCMake-be6a555d7ec9348575e3431bd6709f48dc959100.zip
CMake-be6a555d7ec9348575e3431bd6709f48dc959100.tar.gz
CMake-be6a555d7ec9348575e3431bd6709f48dc959100.tar.bz2
Tests: Test setting a generator platform in a toolchain file
Teach the RunCMake.GeneratorPlatform test to cover setting CMAKE_GENERATOR_PLATFORM in a file loaded by CMAKE_TOOLCHAIN_FILE.
Diffstat (limited to 'Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain.cmake')
-rw-r--r--Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain.cmake16
1 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain.cmake b/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain.cmake
new file mode 100644
index 0000000..c4430a5
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain.cmake
@@ -0,0 +1,16 @@
+if("x${CMAKE_GENERATOR_PLATFORM}" STREQUAL "xTest Platform")
+ message(SEND_ERROR "CMAKE_GENERATOR_PLATFORM is \"Test Platform\" as expected.")
+else()
+ message(FATAL_ERROR
+ "CMAKE_GENERATOR_PLATFORM is \"${CMAKE_GENERATOR_PLATFORM}\" "
+ "but should be \"Test Platform\"!")
+endif()
+if(CMAKE_GENERATOR MATCHES "Visual Studio")
+ if("x${CMAKE_VS_PLATFORM_NAME}" STREQUAL "xTest Platform")
+ message(SEND_ERROR "CMAKE_VS_PLATFORM_NAME is \"Test Platform\" as expected.")
+ else()
+ message(FATAL_ERROR
+ "CMAKE_VS_PLATFORM_NAME is \"${CMAKE_VS_PLATFORM_NAME}\" "
+ "but should be \"Test Platform\"!")
+ endif()
+endif()