[Cmake-commits] CMake branch, next, updated. v3.0.1-5223-g8852e38

Brad King brad.king at kitware.com
Mon Sep 8 13:11:34 EDT 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  8852e38dcb041b290ffbbb5954366b19dca45fa9 (commit)
       via  e17751da16c81fba0bec43fc031fc4d09ccd41dc (commit)
       via  6944997bd6aa69fdf88f8e4e154e68d57195b20b (commit)
       via  8d332091702f34fd1e6c1554f137ac6d85b15dc8 (commit)
       via  b97736a23d5d83eb65b6ee0b0429ada9fb331c12 (commit)
       via  0f1f1271e6ddcea9074afe79685a731d4295c1f5 (commit)
       via  4f7d0c421abf047c052cb8d459c8249310cf4f3a (commit)
       via  68d4280ac4cb692b908620884b0842b7a01debeb (commit)
       via  ad2a4776aa34c84a069a9e4d83ea32174ac6e6ac (commit)
       via  03b7b6cda1016dd16491f8051b45a5baa85f2282 (commit)
      from  f2cfe5be4e388a6922699e94bb4a15d2e93d29dd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8852e38dcb041b290ffbbb5954366b19dca45fa9
commit 8852e38dcb041b290ffbbb5954366b19dca45fa9
Merge: f2cfe5b e17751d
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Sep 8 13:11:31 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Sep 8 13:11:31 2014 -0400

    Merge topic 'vs-generator-platform' into next
    
    e17751da Tests: Add generator platform support
    6944997b ExternalProject: Propagate the generator platform
    8d332091 CTest: Add options to set generator platform
    b97736a2 VS: Implement CMAKE_GENERATOR_PLATFORM for VS >= 8
    0f1f1271 CMake: Add CMAKE_GENERATOR_PLATFORM option
    4f7d0c42 Help: Document CMAKE_VS_PLATFORM_NAME variable
    68d4280a VS: Refactor internal default platform name selection
    ad2a4776 cmGlobalVisualStudio10Generator: Re-order some methods
    03b7b6cd cmGlobalGenerator: Call SetGeneratorToolset even for empty toolset


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e17751da16c81fba0bec43fc031fc4d09ccd41dc
commit e17751da16c81fba0bec43fc031fc4d09ccd41dc
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 5 15:40:01 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 5 15:40:01 2014 -0400

    Tests: Add generator platform support
    
    Propagate CMAKE_GENERATOR_PLATFORM through the test hierarchy so that all
    tests can build with the selected generator platform, if any.

diff --git a/Tests/CMakeBuildTest.cmake.in b/Tests/CMakeBuildTest.cmake.in
index aaefe43..f23f820 100644
--- a/Tests/CMakeBuildTest.cmake.in
+++ b/Tests/CMakeBuildTest.cmake.in
@@ -12,6 +12,7 @@ message("running: ${CMAKE_COMMAND}")
 execute_process(COMMAND "${CMAKE_COMMAND}"
   "@CMAKE_BUILD_TEST_SOURCE_DIR@"
   "-G at CMAKE_GENERATOR@"
+  "-DCMAKE_GENERATOR_PLATFORM=@CMAKE_GENERATOR_PLATFORM@"
   -T "@CMAKE_GENERATOR_TOOLSET@"
   WORKING_DIRECTORY "@CMAKE_BUILD_TEST_BINARY_DIR@"
   RESULT_VARIABLE RESULT)
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 7242a00..0b4aef7 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -86,6 +86,11 @@ if(BUILD_TESTING)
   set(build_generator_args
     --build-generator ${CMAKE_GENERATOR}
     )
+  if(CMAKE_GENERATOR_PLATFORM)
+    list(APPEND build_generator_args
+      --build-generator-platform ${CMAKE_GENERATOR_PLATFORM}
+      )
+  endif()
   if(CMAKE_GENERATOR_TOOLSET)
     list(APPEND build_generator_args
       --build-generator-toolset ${CMAKE_GENERATOR_TOOLSET}
@@ -508,6 +513,7 @@ if(BUILD_TESTING)
          "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator"
          --build-two-config
          --build-generator "Eclipse CDT4 - Unix Makefiles"
+         --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
          --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
          --build-project Simple
          --build-options ${build_options}
@@ -523,6 +529,7 @@ if(BUILD_TESTING)
          "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator"
          --build-two-config
          --build-generator "CodeBlocks - Unix Makefiles"
+         --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
          --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
          --build-project Simple
          --build-options ${build_options}
@@ -537,6 +544,7 @@ if(BUILD_TESTING)
          "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator"
          --build-two-config
          --build-generator "KDevelop3 - Unix Makefiles"
+         --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
          --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
          --build-project Simple
          --build-options ${build_options}
@@ -577,6 +585,7 @@ if(BUILD_TESTING)
       "${CMake_SOURCE_DIR}/Tests/SubProject/foo"
       "${CMake_BINARY_DIR}/Tests/SubProject/foo"
       --build-generator ${CMAKE_GENERATOR}
+      --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
       --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
       ${SubProject-Stage2_BUILD_MAKEPROGRAM}
       --build-nocmake
@@ -1288,6 +1297,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
     -DExternalProjectUpdate_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}/Tests/ExternalProjectUpdate
     -DExternalProjectUpdate_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate
     -DCMAKE_GENERATOR=${CMAKE_GENERATOR}
+    -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
     -DCMAKE_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET}
     -DCMAKE_CTEST_COMMAND=${CMAKE_CTEST_COMMAND}
     -P ${CMake_SOURCE_DIR}/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
@@ -1737,6 +1747,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
           --build-two-config
           --build-generator ${CMAKE_GENERATOR}
           --build-makeprogram ${CMake_TEST_DEVENV}
+          --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
           --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
           --build-project VSExcludeFromDefaultBuild
           --test-command ${CMAKE_COMMAND}
@@ -1761,6 +1772,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
         "${CMake_BINARY_DIR}/Tests/VSProjectInSubdir"
         --build-two-config
         --build-generator ${CMAKE_GENERATOR}
+        --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
         --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
         --build-project VSProjectInSubdir
         --build-target test)
@@ -1975,6 +1987,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
 
   # A test for ctest_build() with targets in subdirectories
   set(ctest_configure_options)
+  if(CMAKE_GENERATOR_PLATFORM)
+    list(APPEND ctest_configure_options -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM})
+  endif()
   if(CMAKE_GENERATOR_TOOLSET)
     list(APPEND ctest_configure_options -T ${CMAKE_GENERATOR_TOOLSET})
   endif()
diff --git a/Tests/CMakeOnly/Test.cmake.in b/Tests/CMakeOnly/Test.cmake.in
index 285643a..63c0d9e 100644
--- a/Tests/CMakeOnly/Test.cmake.in
+++ b/Tests/CMakeOnly/Test.cmake.in
@@ -9,6 +9,7 @@ file(MAKE_DIRECTORY "${binary_dir}")
 execute_process(
   COMMAND  ${CMAKE_COMMAND} ${CMAKE_ARGS}
   "${source_dir}" -G "@CMAKE_GENERATOR@"
+  -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
   -T "@CMAKE_GENERATOR_TOOLSET@"
   WORKING_DIRECTORY "${binary_dir}"
   RESULT_VARIABLE result
diff --git a/Tests/CTestConfig/dashboard.cmake.in b/Tests/CTestConfig/dashboard.cmake.in
index 608501c..cb01744 100644
--- a/Tests/CTestConfig/dashboard.cmake.in
+++ b/Tests/CTestConfig/dashboard.cmake.in
@@ -19,6 +19,7 @@ message("cmake initial configure")
 execute_process(COMMAND ${CMAKE_COMMAND}
    ${arg}
    -G "@CMAKE_GENERATOR@"
+   -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
    -T "@CMAKE_GENERATOR_TOOLSET@"
    ${CTEST_SOURCE_DIRECTORY}
   WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY}
diff --git a/Tests/CTestConfig/script.cmake.in b/Tests/CTestConfig/script.cmake.in
index 166de3b..b6ccedb 100644
--- a/Tests/CTestConfig/script.cmake.in
+++ b/Tests/CTestConfig/script.cmake.in
@@ -1,4 +1,5 @@
 set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_PROJECT_NAME "CTestConfig")
 set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestConfig")
diff --git a/Tests/CTestTest/test.cmake.in b/Tests/CTestTest/test.cmake.in
index ab39b88..bb6346b 100644
--- a/Tests/CTestTest/test.cmake.in
+++ b/Tests/CTestTest/test.cmake.in
@@ -41,6 +41,7 @@ set (CTEST_INITIAL_CACHE "
 SITE:STRING=@SITE@
 BUILDNAME:STRING=SmallAndFast- at BUILDNAME@
 CMAKE_GENERATOR:INTERNAL=@CMAKE_GENERATOR@
+CMAKE_GENERATOR_PLATFORM:INTERNAL=@CMAKE_GENERATOR_PLATFORM@
 CMAKE_GENERATOR_TOOLSET:INTERNAL=@CMAKE_GENERATOR_TOOLSET@
 CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@
 CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@
diff --git a/Tests/CTestTest2/test.cmake.in b/Tests/CTestTest2/test.cmake.in
index c5a7b45..852bb6b 100644
--- a/Tests/CTestTest2/test.cmake.in
+++ b/Tests/CTestTest2/test.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Source/kwsys")
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTest2/kwsysBin")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_MEMORYCHECK_COMMAND           "@MEMORYCHECK_COMMAND@")
diff --git a/Tests/CTestTestBadExe/test.cmake.in b/Tests/CTestTestBadExe/test.cmake.in
index 601aab4..43a8572 100644
--- a/Tests/CTestTestBadExe/test.cmake.in
+++ b/Tests/CTestTestBadExe/test.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestBadEx
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestBadExe")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/CTestTestBadGenerator/test.cmake.in b/Tests/CTestTestBadGenerator/test.cmake.in
index fe4fba8..ae6d0b5 100644
--- a/Tests/CTestTestBadGenerator/test.cmake.in
+++ b/Tests/CTestTestBadGenerator/test.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestBadGe
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestBadGenerator")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "Bad Generator")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/CTestTestChecksum/test.cmake.in b/Tests/CTestTestChecksum/test.cmake.in
index 8413443..32d62bb 100644
--- a/Tests/CTestTestChecksum/test.cmake.in
+++ b/Tests/CTestTestChecksum/test.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestParal
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestParallel")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in b/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in
index d3510bb..6d29af7 100644
--- a/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in
+++ b/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestConfi
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestConfigFileInBuildDir1")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in b/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in
index 99b002c..fb298d4 100644
--- a/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in
+++ b/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestConfi
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestConfigFileInBuildDir2")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/CTestTestCostSerial/test.cmake.in b/Tests/CTestTestCostSerial/test.cmake.in
index ce8720c..9b32a46 100644
--- a/Tests/CTestTestCostSerial/test.cmake.in
+++ b/Tests/CTestTestCostSerial/test.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestCostS
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestCostSerial")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/CTestTestCrash/test.cmake.in b/Tests/CTestTestCrash/test.cmake.in
index 5906d12..3641cb0 100644
--- a/Tests/CTestTestCrash/test.cmake.in
+++ b/Tests/CTestTestCrash/test.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestCrash
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestCrash")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/CTestTestCycle/test.cmake.in b/Tests/CTestTestCycle/test.cmake.in
index 478badb..4a63dd6 100644
--- a/Tests/CTestTestCycle/test.cmake.in
+++ b/Tests/CTestTestCycle/test.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestCycle
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestCycle")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/CTestTestDepends/test.cmake.in b/Tests/CTestTestDepends/test.cmake.in
index a7de8cc..74fddb3 100644
--- a/Tests/CTestTestDepends/test.cmake.in
+++ b/Tests/CTestTestDepends/test.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestDepen
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestDepends")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/CTestTestFailedSubmits/test.cmake.in b/Tests/CTestTestFailedSubmits/test.cmake.in
index 36a09cf..5ff836f 100644
--- a/Tests/CTestTestFailedSubmits/test.cmake.in
+++ b/Tests/CTestTestFailedSubmits/test.cmake.in
@@ -21,6 +21,7 @@ set(CTEST_SOURCE_DIRECTORY              "@source@")
 set(CTEST_BINARY_DIRECTORY              "@build@")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/CTestTestFailure/testNoBuild.cmake.in b/Tests/CTestTestFailure/testNoBuild.cmake.in
index 143daf8..86333af 100644
--- a/Tests/CTestTestFailure/testNoBuild.cmake.in
+++ b/Tests/CTestTestFailure/testNoBuild.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestFailu
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestFailure")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/CTestTestFailure/testNoExe.cmake.in b/Tests/CTestTestFailure/testNoExe.cmake.in
index 11a1930..8875cee 100644
--- a/Tests/CTestTestFailure/testNoExe.cmake.in
+++ b/Tests/CTestTestFailure/testNoExe.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestFailu
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestFailure")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/CTestTestFdSetSize/test.cmake.in b/Tests/CTestTestFdSetSize/test.cmake.in
index fbe0e82..bfe4459 100644
--- a/Tests/CTestTestFdSetSize/test.cmake.in
+++ b/Tests/CTestTestFdSetSize/test.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestFdSet
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestFdSetSize")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/CTestTestLaunchers/test.cmake.in b/Tests/CTestTestLaunchers/test.cmake.in
index 43a6533..03a118a 100644
--- a/Tests/CTestTestLaunchers/test.cmake.in
+++ b/Tests/CTestTestLaunchers/test.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_BUILD_NAME                    "Launchers- at BUILDNAME@-CTestTestLauncher
 set(CTEST_SOURCE_DIRECTORY              "${CTEST_DASHBOARD_SOURCE}/launcher_test_project")
 set(CTEST_BINARY_DIRECTORY              "${CTEST_DASHBOARD_ROOT}/launcher_test_project-bin")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
diff --git a/Tests/CTestTestMemcheck/test.cmake.in b/Tests/CTestTestMemcheck/test.cmake.in
index 87195c5..f2ffd06 100644
--- a/Tests/CTestTestMemcheck/test.cmake.in
+++ b/Tests/CTestTestMemcheck/test.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMAKE_CURRENT_BINARY_DIR@/@SUBTEST_NAM
 set(CTEST_BINARY_DIRECTORY              "@CMAKE_CURRENT_BINARY_DIR@/@SUBTEST_NAME@")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/CTestTestParallel/test.cmake.in b/Tests/CTestTestParallel/test.cmake.in
index 48631ca..045a4ca 100644
--- a/Tests/CTestTestParallel/test.cmake.in
+++ b/Tests/CTestTestParallel/test.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestParal
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestParallel")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/CTestTestResourceLock/test.cmake.in b/Tests/CTestTestResourceLock/test.cmake.in
index 6ec6dfe..67dde18 100644
--- a/Tests/CTestTestResourceLock/test.cmake.in
+++ b/Tests/CTestTestResourceLock/test.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestResou
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestResourceLock")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/CTestTestScheduler/test.cmake.in b/Tests/CTestTestScheduler/test.cmake.in
index 06ba33e..f8c8ab7 100644
--- a/Tests/CTestTestScheduler/test.cmake.in
+++ b/Tests/CTestTestScheduler/test.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestSched
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestScheduler")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/CTestTestSkipReturnCode/test.cmake.in b/Tests/CTestTestSkipReturnCode/test.cmake.in
index d3c44f5..112b0cd 100644
--- a/Tests/CTestTestSkipReturnCode/test.cmake.in
+++ b/Tests/CTestTestSkipReturnCode/test.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestSkipR
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestSkipReturnCode")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/CTestTestStopTime/test.cmake.in b/Tests/CTestTestStopTime/test.cmake.in
index 8adf941..d3a9a4a 100644
--- a/Tests/CTestTestStopTime/test.cmake.in
+++ b/Tests/CTestTestStopTime/test.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestStopT
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestStopTime")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/CTestTestSubdir/test.cmake.in b/Tests/CTestTestSubdir/test.cmake.in
index 5a6caf1..8b3957b 100644
--- a/Tests/CTestTestSubdir/test.cmake.in
+++ b/Tests/CTestTestSubdir/test.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestSubdi
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestSubdir")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/CTestTestTimeout/test.cmake.in b/Tests/CTestTestTimeout/test.cmake.in
index af53383..4b5157e 100644
--- a/Tests/CTestTestTimeout/test.cmake.in
+++ b/Tests/CTestTestTimeout/test.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestTimeo
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestTimeout")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/CTestTestUpload/test.cmake.in b/Tests/CTestTestUpload/test.cmake.in
index bb6ba25..701439d 100644
--- a/Tests/CTestTestUpload/test.cmake.in
+++ b/Tests/CTestTestUpload/test.cmake.in
@@ -8,6 +8,7 @@ set(CTEST_BUILD_NAME                    "CTestTest- at BUILDNAME@-Upload")
 set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestUpload")
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestUpload")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 
diff --git a/Tests/CTestTestZeroTimeout/test.cmake.in b/Tests/CTestTestZeroTimeout/test.cmake.in
index beb6d90..b829fef 100644
--- a/Tests/CTestTestZeroTimeout/test.cmake.in
+++ b/Tests/CTestTestZeroTimeout/test.cmake.in
@@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestZeroT
 set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestZeroTimeout")
 set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
 set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM      "@CMAKE_GENERATOR_PLATFORM@")
 set(CTEST_CMAKE_GENERATOR_TOOLSET       "@CMAKE_GENERATOR_TOOLSET@")
 set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
diff --git a/Tests/ExportImport/CMakeLists.txt b/Tests/ExportImport/CMakeLists.txt
index a6f8921..eaad3d4 100644
--- a/Tests/ExportImport/CMakeLists.txt
+++ b/Tests/ExportImport/CMakeLists.txt
@@ -44,6 +44,7 @@ add_custom_command(
     --build-project Export
     --build-target install
     --build-generator ${CMAKE_GENERATOR}
+    --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
     --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
     --build-options -C${ExportImport_BINARY_DIR}/InitialCache.cmake
   VERBATIM
@@ -65,6 +66,7 @@ add_custom_command(
    --build-noclean
    --build-project Import
    --build-generator ${CMAKE_GENERATOR}
+   --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
    --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
    --build-options -C${ExportImport_BINARY_DIR}/InitialCache.cmake
   VERBATIM
diff --git a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
index ea59a8e..51e768e 100644
--- a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
+++ b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
@@ -13,6 +13,7 @@ macro(check_a_tag desired_tag resulting_sha fetch_expected)
   # Configure
   execute_process(COMMAND ${CMAKE_COMMAND}
     -G ${CMAKE_GENERATOR} -T "${CMAKE_GENERATOR_TOOLSET}"
+    -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
     -DTEST_GIT_TAG:STRING=${desired_tag}
     ${ExternalProjectUpdate_SOURCE_DIR}
     WORKING_DIRECTORY ${ExternalProjectUpdate_BINARY_DIR}
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt
index ef3b317..1982a60 100644
--- a/Tests/Fortran/CMakeLists.txt
+++ b/Tests/Fortran/CMakeLists.txt
@@ -201,6 +201,7 @@ if(TEST_MODULE_DEPENDS)
          --build-two-config
          --build-project ExtFort
          --build-generator ${CMAKE_GENERATOR}
+         --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
          --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
          --build-options -DCMAKE_Fortran_COMPILER:STRING=${CMAKE_Fortran_COMPILER}
                          -DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS}
diff --git a/Tests/FortranC/Flags.cmake.in b/Tests/FortranC/Flags.cmake.in
index 28c38e4..9504fec 100644
--- a/Tests/FortranC/Flags.cmake.in
+++ b/Tests/FortranC/Flags.cmake.in
@@ -15,6 +15,7 @@ set(COMMAND)
 execute_process(
   WORKING_DIRECTORY "${bld}"
   COMMAND ${CMAKE_COMMAND} "${src}" -G "@CMAKE_GENERATOR@"
+                           "-DCMAKE_GENERATOR_PLATFORM=@CMAKE_GENERATOR_PLATFORM@"
                            -T "@CMAKE_GENERATOR_TOOLSET@"
                            "-DFortranC_TEST_FLAGS=1"
                            "-DCMAKE_C_COMPILER=${bld}/cc.sh"
diff --git a/Tests/MacRuntimePath/CMakeLists.txt b/Tests/MacRuntimePath/CMakeLists.txt
index eeb3653..3e9ab8a 100644
--- a/Tests/MacRuntimePath/CMakeLists.txt
+++ b/Tests/MacRuntimePath/CMakeLists.txt
@@ -39,6 +39,7 @@ add_custom_command(
     --build-project MacRuntimePath_A
     --build-target install
     --build-generator ${CMAKE_GENERATOR}
+    --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
     --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
     --build-options -C${MacRuntimePath_BINARY_DIR}/InitialCache.cmake
   VERBATIM
@@ -60,6 +61,7 @@ add_custom_command(
    --build-noclean
    --build-project MacRuntimePath_B
    --build-generator ${CMAKE_GENERATOR}
+   --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
    --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
    --build-options -C${MacRuntimePath_BINARY_DIR}/InitialCache.cmake
   VERBATIM
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index d52a2b6..6735fe2 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -4,6 +4,7 @@ macro(add_RunCMake_test test)
   add_test(RunCMake.${test} ${CMAKE_CMAKE_COMMAND}
     -DCMAKE_MODULE_PATH=${CMAKE_CURRENT_SOURCE_DIR}
     -DRunCMake_GENERATOR=${CMAKE_GENERATOR}
+    -DRunCMake_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
     -DRunCMake_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET}
     -DRunCMake_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/${test}
     -DRunCMake_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/${test}
diff --git a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
index 442eb9f..89cc712 100644
--- a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
@@ -1,13 +1,12 @@
 include(RunCMake)
 
+set(RunCMake_GENERATOR_PLATFORM "")
 run_cmake(NoPlatform)
 
 if("${RunCMake_GENERATOR}" MATCHES "^Visual Studio ([89]|1[0124])( 20[0-9][0-9])?$")
-  set(RunCMake_TEST_OPTIONS "-DCMAKE_GENERATOR_PLATFORM=x64")
+  set(RunCMake_GENERATOR_PLATFORM "x64")
   run_cmake(x64Platform)
-  unset(RunCMake_TEST_OPTIONS)
 else()
-  set(RunCMake_TEST_OPTIONS "-DCMAKE_GENERATOR_PLATFORM=Bad Platform")
+  set(RunCMake_GENERATOR_PLATFORM "Bad Platform")
   run_cmake(BadPlatform)
-  unset(RunCMake_TEST_OPTIONS)
 endif()
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index 2020356..abc3e3d 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -53,6 +53,7 @@ function(run_cmake test)
     execute_process(
       COMMAND ${CMAKE_COMMAND} "${RunCMake_TEST_SOURCE_DIR}"
                 -G "${RunCMake_GENERATOR}"
+                "-DCMAKE_GENERATOR_PLATFORM=${RunCMake_GENERATOR_PLATFORM}"
                 -T "${RunCMake_GENERATOR_TOOLSET}"
                 -DRunCMake_TEST=${test}
                 --no-warn-unused-cli
diff --git a/Tests/StagingPrefix/CMakeLists.txt b/Tests/StagingPrefix/CMakeLists.txt
index 922776d..49ff7fe 100644
--- a/Tests/StagingPrefix/CMakeLists.txt
+++ b/Tests/StagingPrefix/CMakeLists.txt
@@ -38,6 +38,7 @@ add_custom_command(
     --build-project Producer
     --build-target install
     --build-generator ${CMAKE_GENERATOR}
+    --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
     --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
     --build-options
       -DCMAKE_VERBOSE_MAKEFILE=1
@@ -71,6 +72,7 @@ add_custom_command(
    --build-project Consumer
    --build-target install
    --build-generator ${CMAKE_GENERATOR}
+   --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
    --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
    --build-options
       "-DCMAKE_FIND_ROOT_PATH=${CMAKE_BINARY_DIR}/ignored"
diff --git a/Tests/VSExternalInclude/CMakeLists.txt b/Tests/VSExternalInclude/CMakeLists.txt
index cfcccec..37dd4f2 100644
--- a/Tests/VSExternalInclude/CMakeLists.txt
+++ b/Tests/VSExternalInclude/CMakeLists.txt
@@ -19,7 +19,9 @@ make_directory("${LIB2_BINARY_DIR}")
 
 # generate lib1
 execute_process(
-  COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -T "${CMAKE_GENERATOR_TOOLSET}" "${VSExternalInclude_SOURCE_DIR}/Lib1"
+  COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
+    -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
+    -T "${CMAKE_GENERATOR_TOOLSET}" "${VSExternalInclude_SOURCE_DIR}/Lib1"
   WORKING_DIRECTORY ${LIB1_BINARY_DIR}
   OUTPUT_VARIABLE OUT
   ERROR_VARIABLE OUT
@@ -28,7 +30,9 @@ message("CMAKE Ran with the following output:\n\"${OUT}\"")
 
 # generate lib2
 execute_process(
-  COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -T "${CMAKE_GENERATOR_TOOLSET}" "${VSExternalInclude_SOURCE_DIR}/Lib2"
+  COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
+    -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
+    -T "${CMAKE_GENERATOR_TOOLSET}" "${VSExternalInclude_SOURCE_DIR}/Lib2"
   WORKING_DIRECTORY ${LIB2_BINARY_DIR}
   OUTPUT_VARIABLE OUT
   ERROR_VARIABLE OUT

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6944997bd6aa69fdf88f8e4e154e68d57195b20b
commit 6944997bd6aa69fdf88f8e4e154e68d57195b20b
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 5 15:20:47 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 5 15:20:47 2014 -0400

    ExternalProject: Propagate the generator platform
    
    When the CMAKE_GENERATOR option is given to ExternalProject_Add, look
    also for option CMAKE_GENERATOR_PLATFORM to pass on to cmake as a cache
    definition.  When no CMAKE_GENERATOR option is given explicitly then use
    the current project's CMAKE_GENERATOR_PLATFORM (since we already use its
    CMAKE_GENERATOR).

diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 218066c..32703b2 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -49,6 +49,7 @@
 #    [CONFIGURE_COMMAND cmd...]  # Build tree configuration command
 #    [CMAKE_COMMAND /.../cmake]  # Specify alternative cmake executable
 #    [CMAKE_GENERATOR gen]       # Specify generator for native build
+#    [CMAKE_GENERATOR_PLATFORM p] # Generator-specific platform name
 #    [CMAKE_GENERATOR_TOOLSET t] # Generator-specific toolset name
 #    [CMAKE_ARGS args...]        # Arguments to CMake command line
 #    [CMAKE_CACHE_ARGS args...]  # Initial cache arguments, of the form -Dvar:string=on
@@ -1757,9 +1758,13 @@ function(_ep_add_configure_command name)
     endif()
 
     get_target_property(cmake_generator ${name} _EP_CMAKE_GENERATOR)
+    get_target_property(cmake_generator_platform ${name} _EP_CMAKE_GENERATOR_PLATFORM)
     get_target_property(cmake_generator_toolset ${name} _EP_CMAKE_GENERATOR_TOOLSET)
     if(cmake_generator)
       list(APPEND cmd "-G${cmake_generator}")
+      if(cmake_generator_platform)
+        list(APPEND cmd "-DCMAKE_GENERATOR_PLATFORM=${cmake_generator_platform}")
+      endif()
       if(cmake_generator_toolset)
         list(APPEND cmd "-T${cmake_generator_toolset}")
       endif()
@@ -1769,6 +1774,12 @@ function(_ep_add_configure_command name)
       else()
         list(APPEND cmd "-G${CMAKE_GENERATOR}")
       endif()
+      if(cmake_generator_platform)
+        message(FATAL_ERROR "Option CMAKE_GENERATOR_PLATFORM not allowed without CMAKE_GENERATOR.")
+      endif()
+      if(CMAKE_GENERATOR_PLATFORM)
+        list(APPEND cmd "-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}")
+      endif()
       if(cmake_generator_toolset)
         message(FATAL_ERROR "Option CMAKE_GENERATOR_TOOLSET not allowed without CMAKE_GENERATOR.")
       endif()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8d332091702f34fd1e6c1554f137ac6d85b15dc8
commit 8d332091702f34fd1e6c1554f137ac6d85b15dc8
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 5 15:14:13 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 5 15:18:21 2014 -0400

    CTest: Add options to set generator platform
    
    The ctest_configure command already reads the CTEST_CMAKE_GENERATOR
    variable to get the value for the cmake -G option.  Read new variable
    CTEST_CMAKE_GENERATOR_PLATFORM to pass on as CMAKE_GENERATOR_PLATFORM.
    
    The "ctest --build-and-test" mode already has "--build-generator" to
    specify the -G option to CMake.  Add a "--build-generator-platform" option
    to specify a value to pass on as CMAKE_GENERATOR_PLATFORM.

diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 52e4beb..a3210a9 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -258,6 +258,9 @@ Options
 ``--build-generator``
  Specify the generator to use.
 
+``--build-generator-platform``
+ Specify the generator-specific platform.
+
 ``--build-generator-toolset``
  Specify the generator-specific toolset.
 
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index 627832c..ece4697 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -68,6 +68,12 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
     generator += this->BuildGenerator;
     args.push_back(generator);
     }
+  if(!this->BuildGeneratorPlatform.empty())
+    {
+    std::string platform = "-DCMAKE_GENERATOR_PLATFORM=";
+    platform += this->BuildGeneratorPlatform;
+    args.push_back(platform);
+    }
   if(this->BuildGeneratorToolset.size())
     {
     std::string toolset = "-T";
@@ -246,6 +252,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
     // Make the generator available for the Build call below.
     cm.SetGlobalGenerator(cm.CreateGlobalGenerator(
                             this->BuildGenerator));
+    cm.SetGeneratorPlatform(this->BuildGeneratorPlatform);
     cm.SetGeneratorToolset(this->BuildGeneratorToolset);
 
     // Load the cache to make CMAKE_MAKE_PROGRAM available.
@@ -490,6 +497,12 @@ int cmCTestBuildAndTestHandler::ProcessCommandLineArguments(
     idx++;
     this->BuildGenerator = allArgs[idx];
     }
+  if(currentArg == "--build-generator-platform" &&
+     idx < allArgs.size() - 1)
+    {
+    idx++;
+    this->BuildGeneratorPlatform = allArgs[idx];
+    }
   if(currentArg == "--build-generator-toolset" &&
      idx < allArgs.size() - 1)
     {
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.h b/Source/CTest/cmCTestBuildAndTestHandler.h
index d1e9a4d..5a7b916 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.h
+++ b/Source/CTest/cmCTestBuildAndTestHandler.h
@@ -57,6 +57,7 @@ protected:
   std::string  Output;
 
   std::string              BuildGenerator;
+  std::string              BuildGeneratorPlatform;
   std::string              BuildGeneratorToolset;
   std::vector<std::string> BuildOptions;
   bool                     BuildTwoConfig;
diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx
index 1aa8768..8ab5037 100644
--- a/Source/CTest/cmCTestConfigureCommand.cxx
+++ b/Source/CTest/cmCTestConfigureCommand.cxx
@@ -118,6 +118,15 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
       cmakeConfigureCommand += cmakeGeneratorName;
       cmakeConfigureCommand += "\"";
 
+      const char* cmakeGeneratorPlatform =
+        this->Makefile->GetDefinition("CTEST_CMAKE_GENERATOR_PLATFORM");
+      if(cmakeGeneratorPlatform && *cmakeGeneratorPlatform)
+        {
+        cmakeConfigureCommand += " \"-DCMAKE_GENERATOR_PLATFORM=";
+        cmakeConfigureCommand += cmakeGeneratorPlatform;
+        cmakeConfigureCommand += "\"";
+        }
+
       const char* cmakeGeneratorToolset =
         this->Makefile->GetDefinition("CTEST_CMAKE_GENERATOR_TOOLSET");
       if(cmakeGeneratorToolset && *cmakeGeneratorToolset)
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index 2c72b4d..fb97af6 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -86,6 +86,7 @@ static const char * cmDocumentationOptions[][2] =
   {"--build-two-config", "Run CMake twice"},
   {"--build-exe-dir", "Specify the directory for the executable."},
   {"--build-generator", "Specify the generator to use."},
+  {"--build-generator-platform", "Specify the generator-specific platform."},
   {"--build-generator-toolset", "Specify the generator-specific toolset."},
   {"--build-project", "Specify the name of the project to build."},
   {"--build-makeprogram", "Specify the make program to use."},

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b97736a23d5d83eb65b6ee0b0429ada9fb331c12
commit b97736a23d5d83eb65b6ee0b0429ada9fb331c12
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 5 14:53:01 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 5 15:03:56 2014 -0400

    VS: Implement CMAKE_GENERATOR_PLATFORM for VS >= 8
    
    For VS generator names that do not specify the platform name, read
    CMAKE_GENERATOR_PLATFORM to get it.
    
    Extend the RunCMake.GeneratorPlatform test with a case covering
    use of the x64 platform when the test generator is a Visual Studio
    generator whose name does not specify a platform.

diff --git a/Help/generator/Visual Studio 10 2010.rst b/Help/generator/Visual Studio 10 2010.rst
index 000677a..77ea9df 100644
--- a/Help/generator/Visual Studio 10 2010.rst	
+++ b/Help/generator/Visual Studio 10 2010.rst	
@@ -3,10 +3,17 @@ Visual Studio 10 2010
 
 Generates Visual Studio 10 (VS 2010) project files.
 
-It is possible to append a space followed by the platform name to
-create project files for a specific target platform.  E.g.
-"Visual Studio 10 2010 Win64" will create project files for the
-x64 processor; "Visual Studio 10 2010 IA64" for Itanium.
+The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set
+to specify a target platform name.
+
+For compatibility with CMake versions prior to 3.1, one may specify
+a target platform name optionally at the end of this generator name:
+
+``Visual Studio 10 2010 Win64``
+  Specify target platform ``x64``.
+
+``Visual Studio 10 2010 IA64``
+  Specify target platform ``Itanium``.
 
 For compatibility with CMake versions prior to 3.0, one may specify this
-generator using the name "Visual Studio 10" without the year component.
+generator using the name ``Visual Studio 10`` without the year component.
diff --git a/Help/generator/Visual Studio 11 2012.rst b/Help/generator/Visual Studio 11 2012.rst
index 42f6f91..5fa7f2c 100644
--- a/Help/generator/Visual Studio 11 2012.rst	
+++ b/Help/generator/Visual Studio 11 2012.rst	
@@ -3,10 +3,20 @@ Visual Studio 11 2012
 
 Generates Visual Studio 11 (VS 2012) project files.
 
-It is possible to append a space followed by the platform name to
-create project files for a specific target platform.  E.g.
-"Visual Studio 11 2012 Win64" will create project files for the
-x64 processor; "Visual Studio 11 2012 ARM" for ARM.
+The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set
+to specify a target platform name.
+
+For compatibility with CMake versions prior to 3.1, one may specify
+a target platform name optionally at the end of this generator name:
+
+``Visual Studio 11 2012 Win64``
+  Specify target platform ``x64``.
+
+``Visual Studio 11 2012 ARM``
+  Specify target platform ``ARM``.
+
+``Visual Studio 11 2012 <WinCE-SDK>``
+  Specify target platform matching a Windows CE SDK name.
 
 For compatibility with CMake versions prior to 3.0, one may specify this
 generator using the name "Visual Studio 11" without the year component.
diff --git a/Help/generator/Visual Studio 12 2013.rst b/Help/generator/Visual Studio 12 2013.rst
index d2f4912..2c3b119 100644
--- a/Help/generator/Visual Studio 12 2013.rst	
+++ b/Help/generator/Visual Studio 12 2013.rst	
@@ -3,10 +3,17 @@ Visual Studio 12 2013
 
 Generates Visual Studio 12 (VS 2013) project files.
 
-It is possible to append a space followed by the platform name to
-create project files for a specific target platform.  E.g.
-"Visual Studio 12 2013 Win64" will create project files for the
-x64 processor; "Visual Studio 12 2013 ARM" for ARM.
+The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set
+to specify a target platform name.
+
+For compatibility with CMake versions prior to 3.1, one may specify
+a target platform name optionally at the end of this generator name:
+
+``Visual Studio 12 2013 Win64``
+  Specify target platform ``x64``.
+
+``Visual Studio 12 2013 ARM``
+  Specify target platform ``ARM``.
 
 For compatibility with CMake versions prior to 3.0, one may specify this
 generator using the name "Visual Studio 12" without the year component.
diff --git a/Help/generator/Visual Studio 14.rst b/Help/generator/Visual Studio 14.rst
index 7f4fdc3..d621b7e 100644
--- a/Help/generator/Visual Studio 14.rst	
+++ b/Help/generator/Visual Studio 14.rst	
@@ -3,7 +3,14 @@ Visual Studio 14
 
 Generates Visual Studio 14 project files.
 
-It is possible to append a space followed by the platform name to
-create project files for a specific target platform.  E.g.
-"Visual Studio 14 Win64" will create project files for the
-x64 processor; "Visual Studio 14 ARM" for ARM.
+The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set
+to specify a target platform name.
+
+For compatibility with CMake versions prior to 3.1, one may specify
+a target platform name optionally at the end of this generator name:
+
+``Visual Studio 14 Win64``
+  Specify target platform ``x64``.
+
+``Visual Studio 14 ARM``
+  Specify target platform ``ARM``.
diff --git a/Help/generator/Visual Studio 8 2005.rst b/Help/generator/Visual Studio 8 2005.rst
index d7b6de2..29012c3 100644
--- a/Help/generator/Visual Studio 8 2005.rst	
+++ b/Help/generator/Visual Studio 8 2005.rst	
@@ -3,6 +3,14 @@ Visual Studio 8 2005
 
 Generates Visual Studio 8 2005 project files.
 
-It is possible to append a space followed by the platform name to
-create project files for a specific target platform.  E.g.  "Visual
-Studio 8 2005 Win64" will create project files for the x64 processor.
+The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set
+to specify a target platform name.
+
+For compatibility with CMake versions prior to 3.1, one may specify
+a target platform name optionally at the end of this generator name:
+
+``Visual Studio 8 2005 Win64``
+  Specify target platform ``x64``.
+
+``Visual Studio 8 2005 <WinCE-SDK>``
+  Specify target platform matching a Windows CE SDK name.
diff --git a/Help/generator/Visual Studio 9 2008.rst b/Help/generator/Visual Studio 9 2008.rst
index ade9fd5..40471b9 100644
--- a/Help/generator/Visual Studio 9 2008.rst	
+++ b/Help/generator/Visual Studio 9 2008.rst	
@@ -3,7 +3,17 @@ Visual Studio 9 2008
 
 Generates Visual Studio 9 2008 project files.
 
-It is possible to append a space followed by the platform name to
-create project files for a specific target platform.  E.g.  "Visual
-Studio 9 2008 Win64" will create project files for the x64 processor;
-"Visual Studio 9 2008 IA64" for Itanium.
+The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set
+to specify a target platform name.
+
+For compatibility with CMake versions prior to 3.1, one may specify
+a target platform name optionally at the end of this generator name:
+
+``Visual Studio 9 2008 Win64``
+  Specify target platform ``x64``.
+
+``Visual Studio 9 2008 IA64``
+  Specify target platform ``Itanium``.
+
+``Visual Studio 9 2008 <WinCE-SDK>``
+  Specify target platform matching a Windows CE SDK name.
diff --git a/Help/release/dev/vs-generator-platform.rst b/Help/release/dev/vs-generator-platform.rst
new file mode 100644
index 0000000..df90e19
--- /dev/null
+++ b/Help/release/dev/vs-generator-platform.rst
@@ -0,0 +1,7 @@
+vs-generator-platform
+---------------------
+
+* The Visual Studio generators for versions 8 (2005) and above
+  learned to read the target platform name from a new
+  :variable:`CMAKE_GENERATOR_PLATFORM` variable when it is
+  not specified as part of the generator name.
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index e753c3c..e2d4645 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -125,6 +125,18 @@ bool cmGlobalVisualStudio10Generator::SetSystemName(std::string const& s,
     {
     return false;
     }
+  return this->cmGlobalVisualStudio8Generator::SetSystemName(s, mf);
+}
+
+//----------------------------------------------------------------------------
+bool
+cmGlobalVisualStudio10Generator::SetGeneratorPlatform(std::string const& p,
+                                                      cmMakefile* mf)
+{
+  if(!this->cmGlobalVisualStudio8Generator::SetGeneratorPlatform(p, mf))
+    {
+    return false;
+    }
   if(this->GetPlatformName() == "Itanium" || this->GetPlatformName() == "x64")
     {
     if(this->IsExpressEdition() && !this->Find64BitTools(mf))
@@ -132,7 +144,7 @@ bool cmGlobalVisualStudio10Generator::SetSystemName(std::string const& s,
       return false;
       }
     }
-  return this->cmGlobalVisualStudio8Generator::SetSystemName(s, mf);
+  return true;
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 1155508..f1ff9a4 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -31,6 +31,7 @@ public:
   virtual bool MatchesGeneratorName(const std::string& name) const;
 
   virtual bool SetSystemName(std::string const& s, cmMakefile* mf);
+  virtual bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf);
   virtual bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf);
 
   virtual void GenerateBuildCommand(
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index cb82e54..401e475 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -262,6 +262,10 @@ cmLocalGenerator *cmGlobalVisualStudio7Generator::CreateLocalGenerator()
 //----------------------------------------------------------------------------
 std::string const& cmGlobalVisualStudio7Generator::GetPlatformName() const
 {
+  if(!this->GeneratorPlatform.empty())
+    {
+    return this->GeneratorPlatform;
+    }
   return this->DefaultPlatformName;
 }
 
@@ -269,6 +273,15 @@ std::string const& cmGlobalVisualStudio7Generator::GetPlatformName() const
 bool cmGlobalVisualStudio7Generator::SetSystemName(std::string const& s,
                                                    cmMakefile* mf)
 {
+  mf->AddDefinition("CMAKE_VS_INTEL_Fortran_PROJECT_VERSION",
+                    this->GetIntelProjectVersion());
+  return this->cmGlobalVisualStudioGenerator::SetSystemName(s, mf);
+}
+
+//----------------------------------------------------------------------------
+bool cmGlobalVisualStudio7Generator::SetGeneratorPlatform(std::string const& p,
+                                                          cmMakefile* mf)
+{
   if(this->GetPlatformName() == "x64")
     {
     mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE");
@@ -278,9 +291,7 @@ bool cmGlobalVisualStudio7Generator::SetSystemName(std::string const& s,
     mf->AddDefinition("CMAKE_FORCE_IA64", "TRUE");
     }
   mf->AddDefinition("CMAKE_VS_PLATFORM_NAME", this->GetPlatformName().c_str());
-  mf->AddDefinition("CMAKE_VS_INTEL_Fortran_PROJECT_VERSION",
-                    this->GetIntelProjectVersion());
-  return this->cmGlobalVisualStudioGenerator::SetSystemName(s, mf);
+  return this->cmGlobalVisualStudioGenerator::SetGeneratorPlatform(p, mf);
 }
 
 void cmGlobalVisualStudio7Generator::GenerateConfigurations(cmMakefile* mf)
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index dc8b915..04a74db 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -46,6 +46,8 @@ public:
 
   virtual bool SetSystemName(std::string const& s, cmMakefile* mf);
 
+  virtual bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf);
+
   /** Get the documentation entry for this generator.  */
   static void GetDocumentation(cmDocumentationEntry& entry);
 
@@ -175,6 +177,7 @@ protected:
   // Set during OutputSLNFile with the name of the current project.
   // There is one SLN file per project.
   std::string CurrentProject;
+  std::string GeneratorPlatform;
   std::string DefaultPlatformName;
   bool MasmEnabled;
 
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index c91730f..745515b 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -159,6 +159,21 @@ void cmGlobalVisualStudio8Generator::AddPlatformDefinitions(cmMakefile* mf)
 }
 
 //----------------------------------------------------------------------------
+bool cmGlobalVisualStudio8Generator::SetGeneratorPlatform(std::string const& p,
+                                                          cmMakefile* mf)
+{
+  if(this->DefaultPlatformName == "Win32")
+    {
+    this->GeneratorPlatform = p;
+    return this->cmGlobalVisualStudio7Generator::SetGeneratorPlatform("", mf);
+    }
+  else
+    {
+    return this->cmGlobalVisualStudio7Generator::SetGeneratorPlatform(p, mf);
+    }
+}
+
+//----------------------------------------------------------------------------
 // ouput standard header for dsw file
 void cmGlobalVisualStudio8Generator::WriteSLNHeader(std::ostream& fout)
 {
diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h
index cb6d3d9..4b41ed7 100644
--- a/Source/cmGlobalVisualStudio8Generator.h
+++ b/Source/cmGlobalVisualStudio8Generator.h
@@ -40,6 +40,8 @@ public:
                               cmMakefile *, bool optional);
   virtual void AddPlatformDefinitions(cmMakefile* mf);
 
+  virtual bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf);
+
   /**
    * Override Configure and Generate to add the build-system check
    * target.
diff --git a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
index 60217bc..442eb9f 100644
--- a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
@@ -2,6 +2,12 @@ include(RunCMake)
 
 run_cmake(NoPlatform)
 
-set(RunCMake_TEST_OPTIONS "-DCMAKE_GENERATOR_PLATFORM=Bad Platform")
-run_cmake(BadPlatform)
-unset(RunCMake_TEST_OPTIONS)
+if("${RunCMake_GENERATOR}" MATCHES "^Visual Studio ([89]|1[0124])( 20[0-9][0-9])?$")
+  set(RunCMake_TEST_OPTIONS "-DCMAKE_GENERATOR_PLATFORM=x64")
+  run_cmake(x64Platform)
+  unset(RunCMake_TEST_OPTIONS)
+else()
+  set(RunCMake_TEST_OPTIONS "-DCMAKE_GENERATOR_PLATFORM=Bad Platform")
+  run_cmake(BadPlatform)
+  unset(RunCMake_TEST_OPTIONS)
+endif()
diff --git a/Tests/RunCMake/GeneratorPlatform/x64Platform-stdout.txt b/Tests/RunCMake/GeneratorPlatform/x64Platform-stdout.txt
new file mode 100644
index 0000000..05a83ff
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/x64Platform-stdout.txt
@@ -0,0 +1,2 @@
+-- CMAKE_GENERATOR_PLATFORM is 'x64' as expected.
+-- CMAKE_VS_PLATFORM_NAME is 'x64' as expected.
diff --git a/Tests/RunCMake/GeneratorPlatform/x64Platform.cmake b/Tests/RunCMake/GeneratorPlatform/x64Platform.cmake
new file mode 100644
index 0000000..a23bdc7
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/x64Platform.cmake
@@ -0,0 +1,7 @@
+foreach(v CMAKE_GENERATOR_PLATFORM CMAKE_VS_PLATFORM_NAME)
+  if("x${${v}}" STREQUAL "xx64")
+    message(STATUS "${v} is 'x64' as expected.")
+  else()
+    message(FATAL_ERROR "${v} is '${${v}}' but should be 'x64'!")
+  endif()
+endforeach()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0f1f1271e6ddcea9074afe79685a731d4295c1f5
commit 0f1f1271e6ddcea9074afe79685a731d4295c1f5
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 5 14:25:27 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 5 14:38:05 2014 -0400

    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.

diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 4d77eda..149e4ac 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -37,6 +37,7 @@ Variables that Provide Information
    /variable/CMAKE_EXTRA_GENERATOR
    /variable/CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES
    /variable/CMAKE_GENERATOR
+   /variable/CMAKE_GENERATOR_PLATFORM
    /variable/CMAKE_GENERATOR_TOOLSET
    /variable/CMAKE_HOME_DIRECTORY
    /variable/CMAKE_IMPORT_LIBRARY_PREFIX
diff --git a/Help/variable/CMAKE_GENERATOR_PLATFORM.rst b/Help/variable/CMAKE_GENERATOR_PLATFORM.rst
new file mode 100644
index 0000000..44d7fc4
--- /dev/null
+++ b/Help/variable/CMAKE_GENERATOR_PLATFORM.rst
@@ -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.
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 42efec2..90fd3f3 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -76,6 +76,27 @@ cmGlobalGenerator::~cmGlobalGenerator()
     }
 }
 
+bool cmGlobalGenerator::SetGeneratorPlatform(std::string const& p,
+                                             cmMakefile* mf)
+{
+  if(p.empty())
+    {
+    return true;
+    }
+  else
+    {
+    cmOStringStream e;
+    e <<
+      "Generator\n"
+      "  " << this->GetName() << "\n"
+      "does not support platform specification, but platform\n"
+      "  " << p << "\n"
+      "was specified.";
+    mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+    return false;
+    }
+}
+
 bool cmGlobalGenerator::SetGeneratorToolset(std::string const& ts,
                                             cmMakefile* mf)
 {
@@ -459,6 +480,14 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
     return;
     }
 
+  // Tell the generator about the platform, if any.
+  std::string platform = mf->GetSafeDefinition("CMAKE_GENERATOR_PLATFORM");
+  if(!this->SetGeneratorPlatform(platform, mf))
+    {
+    cmSystemTools::SetFatalErrorOccured();
+    return;
+    }
+
   // Tell the generator about the toolset, if any.
   std::string toolset = mf->GetSafeDefinition("CMAKE_GENERATOR_TOOLSET");
   if(!this->SetGeneratorToolset(toolset, mf))
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index f80c3c7..f166789 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -65,6 +65,10 @@ public:
   virtual bool SetSystemName(std::string const&, cmMakefile*)
     { return true; }
 
+  /** Set the generator-specific platform name.  Returns true if platform
+      is supported and false otherwise.  */
+  virtual bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf);
+
   /** Set the generator-specific toolset name.  Returns true if toolset
       is supported and false otherwise.  */
   virtual bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf);
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 04b2d27..efdaeec 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3548,6 +3548,7 @@ int cmMakefile::TryCompile(const std::string& srcdir,
   cm.SetHomeOutputDirectory(bindir);
   cm.SetStartDirectory(srcdir);
   cm.SetStartOutputDirectory(bindir);
+  cm.SetGeneratorPlatform(this->GetCMakeInstance()->GetGeneratorPlatform());
   cm.SetGeneratorToolset(this->GetCMakeInstance()->GetGeneratorToolset());
   cm.LoadCache();
   if(!gg->IsMultiConfig())
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 6cc3b81..c9c63c7 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1445,6 +1445,34 @@ int cmake::ActualConfigure()
                         cmCacheManager::INTERNAL);
     }
 
+  if(const char* platformName =
+     this->CacheManager->GetCacheValue("CMAKE_GENERATOR_PLATFORM"))
+    {
+    if(this->GeneratorPlatform.empty())
+      {
+      this->GeneratorPlatform = platformName;
+      }
+    else if(this->GeneratorPlatform != platformName)
+      {
+      std::string message = "Error: generator platform: ";
+      message += this->GeneratorPlatform;
+      message += "\nDoes not match the platform used previously: ";
+      message += platformName;
+      message +=
+        "\nEither remove the CMakeCache.txt file and CMakeFiles "
+        "directory or choose a different binary directory.";
+      cmSystemTools::Error(message.c_str());
+      return -2;
+      }
+    }
+  else
+    {
+    this->CacheManager->AddCacheEntry("CMAKE_GENERATOR_PLATFORM",
+                                      this->GeneratorPlatform.c_str(),
+                                      "Name of generator platform.",
+                                      cmCacheManager::INTERNAL);
+    }
+
   if(const char* tsName =
      this->CacheManager->GetCacheValue("CMAKE_GENERATOR_TOOLSET"))
     {
diff --git a/Source/cmake.h b/Source/cmake.h
index 2d04902..919fc24 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -191,6 +191,14 @@ class cmake
   ///! Get the names of the current registered generators
   void GetRegisteredGenerators(std::vector<std::string>& names);
 
+  ///! Set the name of the selected generator-specific platform.
+  void SetGeneratorPlatform(std::string const& ts)
+    { this->GeneratorPlatform = ts; }
+
+  ///! Get the name of the selected generator-specific platform.
+  std::string const& GetGeneratorPlatform() const
+    { return this->GeneratorPlatform; }
+
   ///! Set the name of the selected generator-specific toolset.
   void SetGeneratorToolset(std::string const& ts)
     { this->GeneratorToolset = ts; }
@@ -403,6 +411,7 @@ protected:
   std::string StartOutputDirectory;
   bool SuppressDevWarnings;
   bool DoSuppressDevWarnings;
+  std::string GeneratorPlatform;
   std::string GeneratorToolset;
 
   ///! read in a cmake list file to initialize the cache
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 3cd9947..d52a2b6 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -58,6 +58,7 @@ add_RunCMake_test(ExternalData)
 add_RunCMake_test(FeatureSummary)
 add_RunCMake_test(FPHSA)
 add_RunCMake_test(GeneratorExpression)
+add_RunCMake_test(GeneratorPlatform)
 add_RunCMake_test(GeneratorToolset)
 add_RunCMake_test(TargetPropertyGeneratorExpressions)
 add_RunCMake_test(Languages)
diff --git a/Tests/RunCMake/GeneratorPlatform/BadPlatform-result.txt b/Tests/RunCMake/GeneratorPlatform/BadPlatform-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/BadPlatform-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorPlatform/BadPlatform-stderr.txt b/Tests/RunCMake/GeneratorPlatform/BadPlatform-stderr.txt
new file mode 100644
index 0000000..e315714
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/BadPlatform-stderr.txt
@@ -0,0 +1,10 @@
+CMake Error at CMakeLists.txt:[0-9]+ \(project\):
+  Generator
+
+    .*
+
+  does not support platform specification, but platform
+
+    Bad Platform
+
+  was specified.$
diff --git a/Tests/RunCMake/GeneratorPlatform/BadPlatform.cmake b/Tests/RunCMake/GeneratorPlatform/BadPlatform.cmake
new file mode 100644
index 0000000..2fc38e5
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/BadPlatform.cmake
@@ -0,0 +1 @@
+message(FATAL_ERROR "This should not be reached!")
diff --git a/Tests/RunCMake/GeneratorPlatform/CMakeLists.txt b/Tests/RunCMake/GeneratorPlatform/CMakeLists.txt
new file mode 100644
index 0000000..12cd3c7
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.4)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/GeneratorPlatform/NoPlatform-result.txt b/Tests/RunCMake/GeneratorPlatform/NoPlatform-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/NoPlatform-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorPlatform/NoPlatform-stderr.txt b/Tests/RunCMake/GeneratorPlatform/NoPlatform-stderr.txt
new file mode 100644
index 0000000..e1c0da4
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/NoPlatform-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at NoPlatform.cmake:2 \(message\):
+  CMAKE_GENERATOR_PLATFORM is empty as expected.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorPlatform/NoPlatform.cmake b/Tests/RunCMake/GeneratorPlatform/NoPlatform.cmake
new file mode 100644
index 0000000..1e0ca6d
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/NoPlatform.cmake
@@ -0,0 +1,7 @@
+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()
diff --git a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
new file mode 100644
index 0000000..60217bc
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
@@ -0,0 +1,7 @@
+include(RunCMake)
+
+run_cmake(NoPlatform)
+
+set(RunCMake_TEST_OPTIONS "-DCMAKE_GENERATOR_PLATFORM=Bad Platform")
+run_cmake(BadPlatform)
+unset(RunCMake_TEST_OPTIONS)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4f7d0c421abf047c052cb8d459c8249310cf4f3a
commit 4f7d0c421abf047c052cb8d459c8249310cf4f3a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 5 14:23:35 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 5 14:23:35 2014 -0400

    Help: Document CMAKE_VS_PLATFORM_NAME variable

diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 2124f7d..4d77eda 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -73,6 +73,7 @@ Variables that Provide Information
    /variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION
    /variable/CMAKE_VS_MSBUILD_COMMAND
    /variable/CMAKE_VS_MSDEV_COMMAND
+   /variable/CMAKE_VS_PLATFORM_NAME
    /variable/CMAKE_VS_PLATFORM_TOOLSET
    /variable/CMAKE_XCODE_PLATFORM_TOOLSET
    /variable/PROJECT_BINARY_DIR
diff --git a/Help/variable/CMAKE_VS_PLATFORM_NAME.rst b/Help/variable/CMAKE_VS_PLATFORM_NAME.rst
new file mode 100644
index 0000000..c6f8d41
--- /dev/null
+++ b/Help/variable/CMAKE_VS_PLATFORM_NAME.rst
@@ -0,0 +1,7 @@
+CMAKE_VS_PLATFORM_NAME
+----------------------
+
+Visual Studio target platform name.
+
+VS 8 and above allow project files to specify a target platform.
+CMake provides the name of the chosen platform in this variable.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=68d4280ac4cb692b908620884b0842b7a01debeb
commit 68d4280ac4cb692b908620884b0842b7a01debeb
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 5 14:02:58 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 5 14:02:58 2014 -0400

    VS: Refactor internal default platform name selection
    
    Rename the 'PlatformName' member to 'DefaultPlatformName' and make
    sure it is only read through a 'GetPlatformName()' call.  This will
    allow non-default names to be chosen later.

diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 063e9e1..e753c3c 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -125,7 +125,7 @@ bool cmGlobalVisualStudio10Generator::SetSystemName(std::string const& s,
     {
     return false;
     }
-  if(this->PlatformName == "Itanium" || this->PlatformName == "x64")
+  if(this->GetPlatformName() == "Itanium" || this->GetPlatformName() == "x64")
     {
     if(this->IsExpressEdition() && !this->Find64BitTools(mf))
       {
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index e312ff1..cb82e54 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -27,11 +27,11 @@ cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator(
 
   if (platformName.empty())
     {
-    this->PlatformName = "Win32";
+    this->DefaultPlatformName = "Win32";
     }
   else
     {
-    this->PlatformName = platformName;
+    this->DefaultPlatformName = platformName;
     }
 }
 
@@ -260,14 +260,20 @@ cmLocalGenerator *cmGlobalVisualStudio7Generator::CreateLocalGenerator()
 }
 
 //----------------------------------------------------------------------------
+std::string const& cmGlobalVisualStudio7Generator::GetPlatformName() const
+{
+  return this->DefaultPlatformName;
+}
+
+//----------------------------------------------------------------------------
 bool cmGlobalVisualStudio7Generator::SetSystemName(std::string const& s,
                                                    cmMakefile* mf)
 {
-  if(this->PlatformName == "x64")
+  if(this->GetPlatformName() == "x64")
     {
     mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE");
     }
-  else if(this->PlatformName == "Itanium")
+  else if(this->GetPlatformName() == "Itanium")
     {
     mf->AddDefinition("CMAKE_FORCE_IA64", "TRUE");
     }
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index 7e3ed23..dc8b915 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -39,7 +39,7 @@ public:
   static std::string GetActualName() {return "Visual Studio 7";}
 
   ///! Get the name for the platform.
-  const std::string& GetPlatformName() const { return this->PlatformName; }
+  std::string const& GetPlatformName() const;
 
   ///! Create a local generator appropriate to this Global Generator
   virtual cmLocalGenerator *CreateLocalGenerator();
@@ -175,7 +175,7 @@ protected:
   // Set during OutputSLNFile with the name of the current project.
   // There is one SLN file per project.
   std::string CurrentProject;
-  std::string PlatformName;
+  std::string DefaultPlatformName;
   bool MasmEnabled;
 
 private:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ad2a4776aa34c84a069a9e4d83ea32174ac6e6ac
commit ad2a4776aa34c84a069a9e4d83ea32174ac6e6ac
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 5 13:43:52 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 5 13:43:52 2014 -0400

    cmGlobalVisualStudio10Generator: Re-order some methods
    
    Order SetSystemName and SetGeneratorToolset method declarations
    and definitions as they are called.

diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 63c32f9..063e9e1 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -116,19 +116,6 @@ cmGlobalVisualStudio10Generator::MatchesGeneratorName(
 }
 
 //----------------------------------------------------------------------------
-bool
-cmGlobalVisualStudio10Generator::SetGeneratorToolset(std::string const& ts,
-                                                     cmMakefile* mf)
-{
-  this->GeneratorToolset = ts;
-  if(const char* toolset = this->GetPlatformToolset())
-    {
-    mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET", toolset);
-    }
-  return true;
-}
-
-//----------------------------------------------------------------------------
 bool cmGlobalVisualStudio10Generator::SetSystemName(std::string const& s,
                                                     cmMakefile* mf)
 {
@@ -149,6 +136,19 @@ bool cmGlobalVisualStudio10Generator::SetSystemName(std::string const& s,
 }
 
 //----------------------------------------------------------------------------
+bool
+cmGlobalVisualStudio10Generator::SetGeneratorToolset(std::string const& ts,
+                                                     cmMakefile* mf)
+{
+  this->GeneratorToolset = ts;
+  if(const char* toolset = this->GetPlatformToolset())
+    {
+    mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET", toolset);
+    }
+  return true;
+}
+
+//----------------------------------------------------------------------------
 bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf)
 {
   if(this->SystemName == "WindowsPhone")
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index f05b174..1155508 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -30,8 +30,8 @@ public:
 
   virtual bool MatchesGeneratorName(const std::string& name) const;
 
-  virtual bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf);
   virtual bool SetSystemName(std::string const& s, cmMakefile* mf);
+  virtual bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf);
 
   virtual void GenerateBuildCommand(
     std::vector<std::string>& makeCommand,

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=03b7b6cda1016dd16491f8051b45a5baa85f2282
commit 03b7b6cda1016dd16491f8051b45a5baa85f2282
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 5 13:40:31 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 5 13:41:54 2014 -0400

    cmGlobalGenerator: Call SetGeneratorToolset even for empty toolset
    
    Move handling of an empty toolset name into the implementation of the
    method.  This simplifies the VS 10 implementation of default toolset
    selection because it has one code path that is always called.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 3681515..42efec2 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -79,15 +79,22 @@ cmGlobalGenerator::~cmGlobalGenerator()
 bool cmGlobalGenerator::SetGeneratorToolset(std::string const& ts,
                                             cmMakefile* mf)
 {
-  cmOStringStream e;
-  e <<
-    "Generator\n"
-    "  " << this->GetName() << "\n"
-    "does not support toolset specification, but toolset\n"
-    "  " << ts << "\n"
-    "was specified.";
-  mf->IssueMessage(cmake::FATAL_ERROR, e.str());
-  return false;
+  if(ts.empty())
+    {
+    return true;
+    }
+  else
+    {
+    cmOStringStream e;
+    e <<
+      "Generator\n"
+      "  " << this->GetName() << "\n"
+      "does not support toolset specification, but toolset\n"
+      "  " << ts << "\n"
+      "was specified.";
+    mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+    return false;
+    }
 }
 
 std::string cmGlobalGenerator::SelectMakeProgram(
@@ -454,8 +461,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
 
   // Tell the generator about the toolset, if any.
   std::string toolset = mf->GetSafeDefinition("CMAKE_GENERATOR_TOOLSET");
-  if(!toolset.empty() &&
-     !this->SetGeneratorToolset(toolset, mf))
+  if(!this->SetGeneratorToolset(toolset, mf))
     {
     cmSystemTools::SetFatalErrorOccured();
     return;
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 19aa52c..63c32f9 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -121,7 +121,10 @@ cmGlobalVisualStudio10Generator::SetGeneratorToolset(std::string const& ts,
                                                      cmMakefile* mf)
 {
   this->GeneratorToolset = ts;
-  this->AddVSPlatformToolsetDefinition(mf);
+  if(const char* toolset = this->GetPlatformToolset())
+    {
+    mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET", toolset);
+    }
   return true;
 }
 
@@ -142,7 +145,6 @@ bool cmGlobalVisualStudio10Generator::SetSystemName(std::string const& s,
       return false;
       }
     }
-  this->AddVSPlatformToolsetDefinition(mf);
   return this->cmGlobalVisualStudio8Generator::SetSystemName(s, mf);
 }
 
@@ -187,16 +189,6 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsStore(cmMakefile* mf)
 }
 
 //----------------------------------------------------------------------------
-void cmGlobalVisualStudio10Generator
-::AddVSPlatformToolsetDefinition(cmMakefile* mf) const
-{
-  if(const char* toolset = this->GetPlatformToolset())
-    {
-    mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET", toolset);
-    }
-}
-
-//----------------------------------------------------------------------------
 void cmGlobalVisualStudio10Generator::WriteSLNHeader(std::ostream& fout)
 {
   fout << "Microsoft Visual Studio Solution File, Format Version 11.00\n";
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 11fa954..f05b174 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -140,6 +140,5 @@ private:
   virtual std::string FindMSBuildCommand();
   virtual std::string FindDevEnvCommand();
   virtual std::string GetVSMakeProgram() { return this->GetMSBuildCommand(); }
-  void AddVSPlatformToolsetDefinition(cmMakefile* mf) const;
 };
 #endif
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 17f838c..13e6988 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -208,8 +208,11 @@ bool cmGlobalXCodeGenerator::SetGeneratorToolset(std::string const& ts,
   if(this->XcodeVersion >= 30)
     {
     this->GeneratorToolset = ts;
-    mf->AddDefinition("CMAKE_XCODE_PLATFORM_TOOLSET",
-                      this->GeneratorToolset.c_str());
+    if(!this->GeneratorToolset.empty())
+      {
+      mf->AddDefinition("CMAKE_XCODE_PLATFORM_TOOLSET",
+                        this->GeneratorToolset.c_str());
+      }
     return true;
     }
   else

-----------------------------------------------------------------------

Summary of changes:
 Help/generator/Visual Studio 10 2010.rst           |   17 ++++--
 Help/generator/Visual Studio 11 2012.rst           |   18 +++++--
 Help/generator/Visual Studio 12 2013.rst           |   15 ++++--
 Help/generator/Visual Studio 14.rst                |   15 ++++--
 Help/generator/Visual Studio 8 2005.rst            |   14 +++--
 Help/generator/Visual Studio 9 2008.rst            |   18 +++++--
 Help/manual/cmake-variables.7.rst                  |    2 +
 Help/manual/ctest.1.rst                            |    3 ++
 Help/release/dev/vs-generator-platform.rst         |    7 +++
 Help/variable/CMAKE_GENERATOR_PLATFORM.rst         |   13 +++++
 Help/variable/CMAKE_VS_PLATFORM_NAME.rst           |    7 +++
 Modules/ExternalProject.cmake                      |   11 ++++
 Source/CTest/cmCTestBuildAndTestHandler.cxx        |   13 +++++
 Source/CTest/cmCTestBuildAndTestHandler.h          |    1 +
 Source/CTest/cmCTestConfigureCommand.cxx           |    9 ++++
 Source/cmGlobalGenerator.cxx                       |   57 ++++++++++++++++----
 Source/cmGlobalGenerator.h                         |    4 ++
 Source/cmGlobalVisualStudio10Generator.cxx         |   50 +++++++++--------
 Source/cmGlobalVisualStudio10Generator.h           |    4 +-
 Source/cmGlobalVisualStudio7Generator.cxx          |   31 ++++++++---
 Source/cmGlobalVisualStudio7Generator.h            |    7 ++-
 Source/cmGlobalVisualStudio8Generator.cxx          |   15 ++++++
 Source/cmGlobalVisualStudio8Generator.h            |    2 +
 Source/cmGlobalXCodeGenerator.cxx                  |    7 ++-
 Source/cmMakefile.cxx                              |    1 +
 Source/cmake.cxx                                   |   28 ++++++++++
 Source/cmake.h                                     |    9 ++++
 Source/ctest.cxx                                   |    1 +
 Tests/CMakeBuildTest.cmake.in                      |    1 +
 Tests/CMakeLists.txt                               |   15 ++++++
 Tests/CMakeOnly/Test.cmake.in                      |    1 +
 Tests/CTestConfig/dashboard.cmake.in               |    1 +
 Tests/CTestConfig/script.cmake.in                  |    1 +
 Tests/CTestTest/test.cmake.in                      |    1 +
 Tests/CTestTest2/test.cmake.in                     |    1 +
 Tests/CTestTestBadExe/test.cmake.in                |    1 +
 Tests/CTestTestBadGenerator/test.cmake.in          |    1 +
 Tests/CTestTestChecksum/test.cmake.in              |    1 +
 Tests/CTestTestConfigFileInBuildDir/test1.cmake.in |    1 +
 Tests/CTestTestConfigFileInBuildDir/test2.cmake.in |    1 +
 Tests/CTestTestCostSerial/test.cmake.in            |    1 +
 Tests/CTestTestCrash/test.cmake.in                 |    1 +
 Tests/CTestTestCycle/test.cmake.in                 |    1 +
 Tests/CTestTestDepends/test.cmake.in               |    1 +
 Tests/CTestTestFailedSubmits/test.cmake.in         |    1 +
 Tests/CTestTestFailure/testNoBuild.cmake.in        |    1 +
 Tests/CTestTestFailure/testNoExe.cmake.in          |    1 +
 Tests/CTestTestFdSetSize/test.cmake.in             |    1 +
 Tests/CTestTestLaunchers/test.cmake.in             |    1 +
 Tests/CTestTestMemcheck/test.cmake.in              |    1 +
 Tests/CTestTestParallel/test.cmake.in              |    1 +
 Tests/CTestTestResourceLock/test.cmake.in          |    1 +
 Tests/CTestTestScheduler/test.cmake.in             |    1 +
 Tests/CTestTestSkipReturnCode/test.cmake.in        |    1 +
 Tests/CTestTestStopTime/test.cmake.in              |    1 +
 Tests/CTestTestSubdir/test.cmake.in                |    1 +
 Tests/CTestTestTimeout/test.cmake.in               |    1 +
 Tests/CTestTestUpload/test.cmake.in                |    1 +
 Tests/CTestTestZeroTimeout/test.cmake.in           |    1 +
 Tests/ExportImport/CMakeLists.txt                  |    2 +
 .../ExternalProjectUpdateTest.cmake                |    1 +
 Tests/Fortran/CMakeLists.txt                       |    1 +
 Tests/FortranC/Flags.cmake.in                      |    1 +
 Tests/MacRuntimePath/CMakeLists.txt                |    2 +
 Tests/RunCMake/CMakeLists.txt                      |    2 +
 .../BadPlatform-result.txt}                        |    0
 .../BadPlatform-stderr.txt}                        |    4 +-
 .../BadPlatform.cmake}                             |    0
 .../{CMP0004 => GeneratorPlatform}/CMakeLists.txt  |    0
 .../NoPlatform-result.txt}                         |    0
 .../GeneratorPlatform/NoPlatform-stderr.txt        |    4 ++
 Tests/RunCMake/GeneratorPlatform/NoPlatform.cmake  |    7 +++
 .../RunCMake/GeneratorPlatform/RunCMakeTest.cmake  |   12 +++++
 .../GeneratorPlatform/x64Platform-stdout.txt       |    2 +
 Tests/RunCMake/GeneratorPlatform/x64Platform.cmake |    7 +++
 Tests/RunCMake/RunCMake.cmake                      |    1 +
 Tests/StagingPrefix/CMakeLists.txt                 |    2 +
 Tests/VSExternalInclude/CMakeLists.txt             |    8 ++-
 78 files changed, 405 insertions(+), 75 deletions(-)
 create mode 100644 Help/release/dev/vs-generator-platform.rst
 create mode 100644 Help/variable/CMAKE_GENERATOR_PLATFORM.rst
 create mode 100644 Help/variable/CMAKE_VS_PLATFORM_NAME.rst
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => GeneratorPlatform/BadPlatform-result.txt} (100%)
 copy Tests/RunCMake/{GeneratorToolset/BadToolset-stderr.txt => GeneratorPlatform/BadPlatform-stderr.txt} (55%)
 copy Tests/RunCMake/{GeneratorToolset/BadToolset.cmake => GeneratorPlatform/BadPlatform.cmake} (100%)
 copy Tests/RunCMake/{CMP0004 => GeneratorPlatform}/CMakeLists.txt (100%)
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => GeneratorPlatform/NoPlatform-result.txt} (100%)
 create mode 100644 Tests/RunCMake/GeneratorPlatform/NoPlatform-stderr.txt
 create mode 100644 Tests/RunCMake/GeneratorPlatform/NoPlatform.cmake
 create mode 100644 Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
 create mode 100644 Tests/RunCMake/GeneratorPlatform/x64Platform-stdout.txt
 create mode 100644 Tests/RunCMake/GeneratorPlatform/x64Platform.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list