[Cmake-commits] CMake branch, next, updated. v2.8.12.1-5344-ga38808a

Brad King brad.king at kitware.com
Tue Nov 19 09:37:29 EST 2013


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  a38808ac0b8fa993e31e2837c67201c762061ea0 (commit)
       via  4cce44b6c50a40ee13f423ae311d5db5a66a13f4 (commit)
       via  558c74d0abfe4f4fc8563ba615b7329083d232bc (commit)
       via  5229f2df63369af1734783ee190cbfc7c41fac8f (commit)
       via  72dd738bd4856dcd2a483e732a26f49e9c6dfcc4 (commit)
       via  fd6076d075d705c4731f71a544436ba82a1577bf (commit)
       via  68031abf15affedc72c13b8b7f1ff025f510bd20 (commit)
       via  003d10c248f3f55cea7885ac83300777d687c8a5 (commit)
       via  e47d934a5a2da9f7589c801c2c232a650e2c797e (commit)
       via  e965cb12e2083d6b869fb30fabe7e290e6094908 (commit)
       via  72bf2552f2c750bc52b9e2cc3f85320d6452c3a4 (commit)
       via  4d1d7725f3e12399dd3785f5ffb7eae7db1be984 (commit)
       via  96966b5c804a95677e43e3938c52afbd42b5d48a (commit)
       via  91a021146c7a8eb256eca7bb3d9be3acfe3ce814 (commit)
       via  123a0608dfe6cf155f0fc095cf389ae7b3d4ebb0 (commit)
      from  787bee6e2dbed97d3abeb68db313c5664ca4d3cd (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=a38808ac0b8fa993e31e2837c67201c762061ea0
commit a38808ac0b8fa993e31e2837c67201c762061ea0
Merge: 787bee6 4cce44b
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Nov 19 09:37:05 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Nov 19 09:37:05 2013 -0500

    Merge topic 'cleanup-build-commands' into next
    
    4cce44b Help: Document the CMAKE_MAKE_PROGRAM variable in more detail
    558c74d VS: Switch to internal CMAKE_MAKE_PROGRAM lookup by generators
    5229f2d Tests: Do not use an explicit make program for VS generators
    72dd738 Tests: Fix MFC test heuristic for empty CMAKE_TEST_MAKEPROGRAM
    fd6076d Tests: Pass CMAKE_MAKE_PROGRAM instead of --build-makeprogram
    68031ab Tests: Configure SubProject-Stage2 test more robustly
    003d10c Tests: Simplify VSExcludeFromDefaultBuild configuration
    e47d934 Tests: Simplify VSProjectInSubdir configuration
    e965cb1 Tests: Simplify CTest.BuildCommand.ProjectInSubdir configuration
    72bf255 Tests: Pass --build-options to every test
    4d1d772 ctest: Teach --build-options to allow zero options
    96966b5 ctest: Make the --build-makeprogram optional for --build-and-test
    91a0211 Simplify some calls to cmGlobalGenerator::Build
    123a060 Teach GenerateBuildCommand to find its own make program


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4cce44b6c50a40ee13f423ae311d5db5a66a13f4
commit 4cce44b6c50a40ee13f423ae311d5db5a66a13f4
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Nov 15 15:34:54 2013 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Nov 18 11:30:51 2013 -0500

    Help: Document the CMAKE_MAKE_PROGRAM variable in more detail
    
    Explain how it is set for each group of generators.  Also explain
    the build-time selection behavior used by Visual Studio generators.

diff --git a/Help/variable/CMAKE_MAKE_PROGRAM.rst b/Help/variable/CMAKE_MAKE_PROGRAM.rst
index b546815..0c851ad 100644
--- a/Help/variable/CMAKE_MAKE_PROGRAM.rst
+++ b/Help/variable/CMAKE_MAKE_PROGRAM.rst
@@ -1,10 +1,51 @@
 CMAKE_MAKE_PROGRAM
 ------------------
 
-Tool used for the actual build process.
+Tool that can launch the native build system.
+The value may be the full path to an executable or just the tool
+name if it is expected to be in the ``PATH``.
 
-This variable is set to the program that will be needed to build the
-output of CMake.  If the generator selected was Visual Studio 6, the
-CMAKE_MAKE_PROGRAM will be set to msdev, for Unix Makefiles it will be
-set to make or gmake, and for Visual Studio 7 it set to devenv.  For
-NMake Makefiles the value is nmake.
+The tool selected depends on the :variable:`CMAKE_GENERATOR` used
+to configure the project:
+
+* The Makefile generators set this to ``make``, ``gmake``, or
+  a generator-specific tool (e.g. ``nmake`` for "NMake Makefiles").
+
+  These generators store ``CMAKE_MAKE_PROGRAM`` in the CMake cache
+  so that it may be edited by the user.
+
+* The Ninja generator sets this to ``ninja``.
+
+  This generator stores ``CMAKE_MAKE_PROGRAM`` in the CMake cache
+  so that it may be edited by the user.
+
+* The Xcode generator sets this to ``xcodebuild`` (or possibly an
+  otherwise undocumented ``cmakexbuild`` wrapper implementing some
+  workarounds).
+
+  This generator stores ``CMAKE_MAKE_PROGRAM`` in the CMake cache
+  so that it may be edited by the user.
+
+* The Visual Studio generators set this to the full path to
+  ``MSBuild.exe`` (VS >= 10), ``devenv.com`` (VS 7,8,9),
+  ``VCExpress.exe`` (VS Express 8,9), or ``msdev.exe`` (VS 6).
+
+  These generators prefer to lookup the build tool at build time
+  rather than to store ``CMAKE_MAKE_PROGRAM`` in the CMake cache
+  ahead of time.  This is because the tools are version-specific
+  and can be located using the Windows Registry.  It is also
+  necessary because the proper build tool may depend on the
+  project content (e.g. the Intel Fortran plugin to VS 10 and 11
+  requires ``devenv.com`` to build its ``.vfproj`` project files
+  even though ``MSBuild.exe`` is normally preferred to support
+  the :variable:`CMAKE_GENERATOR_TOOLSET`).
+
+  For compatibility with versions of CMake prior to 3.0, if
+  a user or project explicitly adds ``CMAKE_MAKE_PROGRAM`` to
+  the CMake cache then CMake will use the specified value if
+  possible.
+
+The ``CMAKE_MAKE_PROGRAM`` variable is set for use by project code.
+The value is also used by the :manual:`cmake(1)` ``--build`` and
+:manual:`ctest(1)` ``--build-and-test`` tools to launch the native
+build process.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=558c74d0abfe4f4fc8563ba615b7329083d232bc
commit 558c74d0abfe4f4fc8563ba615b7329083d232bc
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Nov 15 10:41:45 2013 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Nov 18 11:30:50 2013 -0500

    VS: Switch to internal CMAKE_MAKE_PROGRAM lookup by generators
    
    Drop the "Modules/CMakeVS*FindMake.cmake" files.  Override the
    cmGlobalGenerator::FindMakeProgram method for VS generators to use their
    internal APIs to locate the build tool.  Set the CMAKE_MAKE_PROGRAM as a
    normal variable for use by project code, but do not cache it.  This will
    allow CMake and CTest to select the proper tool at build time.

diff --git a/Modules/CMakeVS10FindMake.cmake b/Modules/CMakeVS10FindMake.cmake
deleted file mode 100644
index 189b626..0000000
--- a/Modules/CMakeVS10FindMake.cmake
+++ /dev/null
@@ -1,54 +0,0 @@
-
-#=============================================================================
-# Copyright 2007-2009 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-# Look for devenv as a build program.  We need to use this to support
-# Intel Fortran integration into VS.  MSBuild can not be used for that case
-# since Intel Fortran uses the older devenv file format.
-find_program(CMAKE_MAKE_PROGRAM
-  NAMES devenv
-  HINTS
-  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;EnvironmentDirectory]
-  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup;Dbghelp_path]
-  "$ENV{ProgramFiles}/Microsoft Visual Studio 10.0/Common7/IDE"
-  "$ENV{ProgramFiles}/Microsoft Visual Studio10.0/Common7/IDE"
-  "$ENV{ProgramFiles}/Microsoft Visual Studio 10/Common7/IDE"
-  "$ENV{ProgramFiles}/Microsoft Visual Studio10/Common7/IDE"
-  "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 10.0/Common7/IDE"
-  "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio10.0/Common7/IDE"
-  "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 10/Common7/IDE"
-  "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio10/Common7/IDE"
-  "/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/"
-  "/Program Files/Microsoft Visual Studio 10/Common7/IDE/"
-  )
-
-# if devenv is not found, then use MSBuild.
-# it is expected that if devenv is not found, then we are
-# dealing with Visual Studio Express.  VCExpress has random
-# failures when being run as a command line build tool which
-# causes the compiler checks and try-compile stuff to fail. MSbuild
-# is a better choice for this.  However, VCExpress does not support
-# cross compiling needed for Win CE.
-if(NOT CMAKE_CROSSCOMPILING)
-  find_program(CMAKE_MAKE_PROGRAM
-    NAMES MSBuild
-    HINTS
-    [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;ProductDir]
-    "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
-    "c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
-    "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\10.0;CLR Version]/")
-endif()
-
-mark_as_advanced(CMAKE_MAKE_PROGRAM)
-set(MSVC10 1)
-set(MSVC_VERSION 1600)
diff --git a/Modules/CMakeVS11FindMake.cmake b/Modules/CMakeVS11FindMake.cmake
deleted file mode 100644
index 2df015d..0000000
--- a/Modules/CMakeVS11FindMake.cmake
+++ /dev/null
@@ -1,53 +0,0 @@
-
-#=============================================================================
-# Copyright 2007-2011 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-# Look for devenv as a build program.  We need to use this to support
-# Intel Fortran integration into VS.  MSBuild can not be used for that case
-# since Intel Fortran uses the older devenv file format.
-find_program(CMAKE_MAKE_PROGRAM
-  NAMES devenv
-  HINTS
-  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;EnvironmentDirectory]
-  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup;Dbghelp_path]
-  "$ENV{ProgramFiles}/Microsoft Visual Studio 11.0/Common7/IDE"
-  "$ENV{ProgramFiles}/Microsoft Visual Studio11.0/Common7/IDE"
-  "$ENV{ProgramFiles}/Microsoft Visual Studio 11/Common7/IDE"
-  "$ENV{ProgramFiles}/Microsoft Visual Studio11/Common7/IDE"
-  "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 11.0/Common7/IDE"
-  "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio11.0/Common7/IDE"
-  "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 11/Common7/IDE"
-  "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio11/Common7/IDE"
-  "/Program Files/Microsoft Visual Studio 11.0/Common7/IDE/"
-  "/Program Files/Microsoft Visual Studio 11/Common7/IDE/"
-  )
-
-# if devenv is not found, then use MSBuild.
-# it is expected that if devenv is not found, then we are
-# dealing with Visual Studio Express.
-if(NOT CMAKE_CROSSCOMPILING)
-  set(_FDIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;FrameworkDir32]")
-  set(_FVER "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;FrameworkVer32]")
-  find_program(CMAKE_MAKE_PROGRAM
-    NAMES MSBuild
-    HINTS
-    ${_FDIR}/${_FVER}
-    [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir]
-    "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;CLR Version]/"
-    "c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;CLR Version]/"
-    "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\11.0;CLR Version]/")
-endif()
-
-mark_as_advanced(CMAKE_MAKE_PROGRAM)
-set(MSVC11 1)
-set(MSVC_VERSION 1700)
diff --git a/Modules/CMakeVS12FindMake.cmake b/Modules/CMakeVS12FindMake.cmake
deleted file mode 100644
index 338d9a2..0000000
--- a/Modules/CMakeVS12FindMake.cmake
+++ /dev/null
@@ -1,27 +0,0 @@
-
-#=============================================================================
-# Copyright 2007-2013 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-# Always use MSBuild because:
-# - devenv treats command-line builds as recently-loaded projects in the IDE
-# - devenv does not appear to support non-standard platform toolsets
-# If we need devenv for Intel Fortran in the future we should add
-# a special case when Fortran is enabled.
-find_program(CMAKE_MAKE_PROGRAM
-  NAMES MSBuild
-  HINTS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\12.0;MSBuildToolsPath]"
-  )
-
-mark_as_advanced(CMAKE_MAKE_PROGRAM)
-set(MSVC12 1)
-set(MSVC_VERSION 1800)
diff --git a/Modules/CMakeVS6FindMake.cmake b/Modules/CMakeVS6FindMake.cmake
deleted file mode 100644
index 40bf5b1..0000000
--- a/Modules/CMakeVS6FindMake.cmake
+++ /dev/null
@@ -1,25 +0,0 @@
-
-#=============================================================================
-# Copyright 2002-2009 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-find_program(CMAKE_MAKE_PROGRAM
-  NAMES msdev
-  PATHS
-  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\6.0\\Setup;VsCommonDir]/MSDev98/Bin
-  "c:/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin"
-  "c:/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin"
-  "/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin"
-  )
-mark_as_advanced(CMAKE_MAKE_PROGRAM)
-set(MSVC60 1)
-set(MSVC_VERSION 1200)
diff --git a/Modules/CMakeVS71FindMake.cmake b/Modules/CMakeVS71FindMake.cmake
deleted file mode 100644
index 945c3fa..0000000
--- a/Modules/CMakeVS71FindMake.cmake
+++ /dev/null
@@ -1,26 +0,0 @@
-
-#=============================================================================
-# Copyright 2003-2009 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-find_program(CMAKE_MAKE_PROGRAM
-  NAMES devenv
-  PATHS
-  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VS;EnvironmentDirectory]
-  "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/Common7/IDE"
-  "c:/Program Files/Microsoft Visual Studio .NET/Common7/IDE"
-  "c:/Program Files/Microsoft Visual Studio.NET/Common7/IDE"
-  "/Program Files/Microsoft Visual Studio .NET/Common7/IDE/"
-  )
-mark_as_advanced(CMAKE_MAKE_PROGRAM)
-set(MSVC71 1)
-set(MSVC_VERSION 1310)
diff --git a/Modules/CMakeVS7FindMake.cmake b/Modules/CMakeVS7FindMake.cmake
deleted file mode 100644
index 218c5f2..0000000
--- a/Modules/CMakeVS7FindMake.cmake
+++ /dev/null
@@ -1,25 +0,0 @@
-
-#=============================================================================
-# Copyright 2002-2009 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-find_program(CMAKE_MAKE_PROGRAM
-  NAMES devenv
-  PATHS
-  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.0\\Setup\\VS;EnvironmentDirectory]
-  "c:/Program Files/Microsoft Visual Studio .NET/Common7/IDE"
-  "c:/Program Files/Microsoft Visual Studio.NET/Common7/IDE"
-  "/Program Files/Microsoft Visual Studio .NET/Common7/IDE/"
-  )
-mark_as_advanced(CMAKE_MAKE_PROGRAM)
-set(MSVC70 1)
-set(MSVC_VERSION 1300)
diff --git a/Modules/CMakeVS8FindMake.cmake b/Modules/CMakeVS8FindMake.cmake
deleted file mode 100644
index 31df026..0000000
--- a/Modules/CMakeVS8FindMake.cmake
+++ /dev/null
@@ -1,34 +0,0 @@
-
-#=============================================================================
-# Copyright 2004-2009 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-# VCExpress does not support cross compiling, which is necessary for Win CE
-set( _CMAKE_MAKE_PROGRAM_NAMES devenv)
-if(NOT CMAKE_CROSSCOMPILING)
-  set( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
-endif()
-
-find_program(CMAKE_MAKE_PROGRAM
-  NAMES ${_CMAKE_MAKE_PROGRAM_NAMES}
-  HINTS
-  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VS;EnvironmentDirectory]
-  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup;Dbghelp_path]
-  "$ENV{ProgramFiles}/Microsoft Visual Studio 8/Common7/IDE"
-  "$ENV{ProgramFiles}/Microsoft Visual Studio8/Common7/IDE"
-  "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/Common7/IDE"
-  "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio8/Common7/IDE"
-  "/Program Files/Microsoft Visual Studio 8/Common7/IDE/"
-  )
-mark_as_advanced(CMAKE_MAKE_PROGRAM)
-set(MSVC80 1)
-set(MSVC_VERSION 1400)
diff --git a/Modules/CMakeVS9FindMake.cmake b/Modules/CMakeVS9FindMake.cmake
deleted file mode 100644
index 35e9f98..0000000
--- a/Modules/CMakeVS9FindMake.cmake
+++ /dev/null
@@ -1,39 +0,0 @@
-
-#=============================================================================
-# Copyright 2007-2009 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-# VCExpress does not support cross compiling, which is necessary for Win CE
-set( _CMAKE_MAKE_PROGRAM_NAMES devenv)
-if(NOT CMAKE_CROSSCOMPILING)
-  set( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
-endif()
-
-find_program(CMAKE_MAKE_PROGRAM
-  NAMES ${_CMAKE_MAKE_PROGRAM_NAMES}
-  HINTS
-  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VS;EnvironmentDirectory]
-  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup;Dbghelp_path]
-  "$ENV{ProgramFiles}/Microsoft Visual Studio 9.0/Common7/IDE"
-  "$ENV{ProgramFiles}/Microsoft Visual Studio9.0/Common7/IDE"
-  "$ENV{ProgramFiles}/Microsoft Visual Studio 9/Common7/IDE"
-  "$ENV{ProgramFiles}/Microsoft Visual Studio9/Common7/IDE"
-  "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9.0/Common7/IDE"
-  "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9.0/Common7/IDE"
-  "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/Common7/IDE"
-  "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9/Common7/IDE"
-  "/Program Files/Microsoft Visual Studio 9.0/Common7/IDE/"
-  "/Program Files/Microsoft Visual Studio 9/Common7/IDE/"
-  )
-mark_as_advanced(CMAKE_MAKE_PROGRAM)
-set(MSVC90 1)
-set(MSVC_VERSION 1500)
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 74d88f3..6e93609 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -203,7 +203,7 @@ public:
   /*
    * Determine what program to use for building the project.
    */
-  void FindMakeProgram(cmMakefile*);
+  virtual void FindMakeProgram(cmMakefile*);
 
   ///! Find a target by name by searching the local generators.
   cmTarget* FindTarget(const char* project, const char* name,
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 741d591..29401c6 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -92,7 +92,6 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator(
   : cmGlobalVisualStudio8Generator(name, platformName,
                                    additionalPlatformDefinition)
 {
-  this->FindMakeProgramFile = "CMakeVS10FindMake.cmake";
   std::string vc10Express;
   this->ExpressEdition = cmSystemTools::ReadRegistryValue(
     "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\10.0\\Setup\\VC;"
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index ad0aa6d..66440ea 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -118,5 +118,6 @@ private:
   bool MSBuildCommandInitialized;
   virtual std::string FindMSBuildCommand();
   virtual std::string FindDevEnvCommand();
+  virtual std::string GetVSMakeProgram() { return this->GetMSBuildCommand(); }
 };
 #endif
diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx
index d968c6d..f1d7312 100644
--- a/Source/cmGlobalVisualStudio11Generator.cxx
+++ b/Source/cmGlobalVisualStudio11Generator.cxx
@@ -112,7 +112,6 @@ cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator(
   : cmGlobalVisualStudio10Generator(name, platformName,
                                    additionalPlatformDefinition)
 {
-  this->FindMakeProgramFile = "CMakeVS11FindMake.cmake";
   std::string vc11Express;
   this->ExpressEdition = cmSystemTools::ReadRegistryValue(
     "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\11.0\\Setup\\VC;"
diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx
index f3806df..edd5567 100644
--- a/Source/cmGlobalVisualStudio12Generator.cxx
+++ b/Source/cmGlobalVisualStudio12Generator.cxx
@@ -87,7 +87,6 @@ cmGlobalVisualStudio12Generator::cmGlobalVisualStudio12Generator(
   : cmGlobalVisualStudio11Generator(name, platformName,
                                    additionalPlatformDefinition)
 {
-  this->FindMakeProgramFile = "CMakeVS12FindMake.cmake";
   std::string vc12Express;
   this->ExpressEdition = cmSystemTools::ReadRegistryValue(
     "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\12.0\\Setup\\VC;"
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index 08ea249..8651da7 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -32,7 +32,6 @@ std::string GetVS6TargetName(const std::string& targetName)
 
 cmGlobalVisualStudio6Generator::cmGlobalVisualStudio6Generator()
 {
-  this->FindMakeProgramFile = "CMakeVS6FindMake.cmake";
   this->MSDevCommandInitialized = false;
 }
 
diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h
index 24f46b3..8fe5792 100644
--- a/Source/cmGlobalVisualStudio6Generator.h
+++ b/Source/cmGlobalVisualStudio6Generator.h
@@ -92,6 +92,7 @@ public:
 protected:
   virtual const char* GetIDEVersion() { return "6.0"; }
 private:
+  virtual std::string GetVSMakeProgram() { return this->GetMSDevCommand(); }
   void GenerateConfigurations(cmMakefile* mf);
   void WriteDSWFile(std::ostream& fout);
   void WriteDSWHeader(std::ostream& fout);
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index 2643719..61d3c4c 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -19,7 +19,6 @@
 cmGlobalVisualStudio71Generator::cmGlobalVisualStudio71Generator(
   const char* platformName) : cmGlobalVisualStudio7Generator(platformName)
 {
-  this->FindMakeProgramFile = "CMakeVS71FindMake.cmake";
   this->ProjectConfigurationSectionName = "ProjectConfiguration";
 }
 
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 08eff31..3d939f3 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -20,7 +20,6 @@
 cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator(
   const char* platformName)
 {
-  this->FindMakeProgramFile = "CMakeVS7FindMake.cmake";
   this->IntelProjectVersion = 0;
   this->DevEnvCommandInitialized = false;
 
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index d272fa0..c7b0081 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -173,6 +173,7 @@ private:
   char* IntelProjectVersion;
   std::string DevEnvCommand;
   bool DevEnvCommandInitialized;
+  virtual std::string GetVSMakeProgram() { return this->GetDevEnvCommand(); }
 };
 
 #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK"
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 949dd1b..69b0a7a 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -94,7 +94,6 @@ cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator(
   const char* additionalPlatformDefinition)
   : cmGlobalVisualStudio71Generator(platformName)
 {
-  this->FindMakeProgramFile = "CMakeVS8FindMake.cmake";
   this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms";
   this->Name = name;
 
diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx
index aadf982..ccc27ad 100644
--- a/Source/cmGlobalVisualStudio9Generator.cxx
+++ b/Source/cmGlobalVisualStudio9Generator.cxx
@@ -101,7 +101,6 @@ cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator(
   : cmGlobalVisualStudio8Generator(name, platformName,
                                    additionalPlatformDefinition)
 {
-  this->FindMakeProgramFile = "CMakeVS9FindMake.cmake";
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index af80070..7afcfa7 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -500,6 +500,19 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target)
 }
 
 //----------------------------------------------------------------------------
+void cmGlobalVisualStudioGenerator::FindMakeProgram(cmMakefile* mf)
+{
+  // Visual Studio generators know how to lookup their build tool
+  // directly instead of needing a helper module to do it, so we
+  // do not actually need to put CMAKE_MAKE_PROGRAM into the cache.
+  if(cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM")))
+    {
+    mf->AddDefinition("CMAKE_MAKE_PROGRAM",
+                      this->GetVSMakeProgram().c_str());
+    }
+}
+
+//----------------------------------------------------------------------------
 void cmGlobalVisualStudioGenerator::AddPlatformDefinitions(cmMakefile* mf)
 {
   if(this->AdditionalPlatformDefinition)
diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h
index ce03a0e..da2d021 100644
--- a/Source/cmGlobalVisualStudioGenerator.h
+++ b/Source/cmGlobalVisualStudioGenerator.h
@@ -82,6 +82,8 @@ public:
   };
   class OrderedTargetDependSet;
 
+  virtual void FindMakeProgram(cmMakefile*);
+
 protected:
   // Does this VS version link targets to each other if there are
   // dependencies in the SLN file?  This was done for VS versions
@@ -107,6 +109,7 @@ protected:
   const char* AdditionalPlatformDefinition;
 
 private:
+  virtual std::string GetVSMakeProgram() = 0;
   void PrintCompilerAdvice(std::ostream&, std::string, const char*) {}
   void ComputeTargetObjects(cmGeneratorTarget* gt) const;
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5229f2df63369af1734783ee190cbfc7c41fac8f
commit 5229f2df63369af1734783ee190cbfc7c41fac8f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Nov 15 09:15:33 2013 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Nov 18 11:30:50 2013 -0500

    Tests: Do not use an explicit make program for VS generators
    
    Do not pass the CMAKE_MAKE_PROGRAM cache entry to tests when using the
    VS generators.  Allow them to pick the correct build tool automatically.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 4e016e1..48abfae 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -47,7 +47,11 @@ configure_file(${CMake_SOURCE_DIR}/Tests/EnforceConfig.cmake.in
 if(BUILD_TESTING)
   set(CMAKE_TEST_DEVENV "")
   if(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
-    set(CMAKE_TEST_MAKEPROGRAM "${CMAKE_MAKE_PROGRAM}")
+    if(CMAKE_TEST_GENERATOR MATCHES "Visual Studio")
+      set(CMAKE_TEST_MAKEPROGRAM "")
+    else()
+      set(CMAKE_TEST_MAKEPROGRAM "${CMAKE_MAKE_PROGRAM}")
+    endif()
     if(CMAKE_TEST_GENERATOR MATCHES "Visual Studio [7-9] " AND
         NOT CMAKE_MAKE_PROGRAM MATCHES "[mM][sS][bB][uU][iI][lL][dD]\\.[eE][xX][eE]")
       set(CMAKE_TEST_DEVENV "${CMAKE_MAKE_PROGRAM}")

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=72dd738bd4856dcd2a483e732a26f49e9c6dfcc4
commit 72dd738bd4856dcd2a483e732a26f49e9c6dfcc4
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Nov 14 14:43:02 2013 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Nov 18 11:30:50 2013 -0500

    Tests: Fix MFC test heuristic for empty CMAKE_TEST_MAKEPROGRAM
    
    Also disable the MFC test if CMAKE_MAKE_PROGRAM is vcexpress.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 6c3e478..4e016e1 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1492,7 +1492,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
 
       # Look for evidence that this is a VCExpress build. If so, avoid
       # the MFC test by default.
-      string(TOLOWER "${CMAKE_TEST_MAKEPROGRAM}" mkprog)
+      string(TOLOWER "${CMAKE_MAKE_PROGRAM};${CMAKE_TEST_MAKEPROGRAM}" mkprog)
       if(mkprog MATCHES "vcexpress")
         message(STATUS
           "CMAKE_TEST_MAKEPROGRAM indicates vcexpress, avoiding MFC test")

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd6076d075d705c4731f71a544436ba82a1577bf
commit fd6076d075d705c4731f71a544436ba82a1577bf
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Nov 15 09:07:42 2013 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Nov 18 11:30:50 2013 -0500

    Tests: Pass CMAKE_MAKE_PROGRAM instead of --build-makeprogram
    
    Pass the CMAKE_TEST_MAKEPROGRAM, if any, to each test at CMake time in
    the CMAKE_MAKE_PROGRAM cache entry.  Pass the CMAKE_TEST_MAKEPROGRAM
    into the ExportImport, Fortran, and MacRuntimePath tests so that they
    may do the same for the nested project configurations.
    
    Now "ctest --build-and-test" can get the make program from the test
    build tree cache, so drop the explicit --build-makeprogram.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 43ae52a..6c3e478 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -80,7 +80,6 @@ if(BUILD_TESTING)
 
   set(build_generator_args
     --build-generator ${CMAKE_TEST_GENERATOR}
-    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
     )
   if(CMAKE_TEST_GENERATOR_TOOLSET)
     list(APPEND build_generator_args
@@ -89,6 +88,9 @@ if(BUILD_TESTING)
   endif()
 
   set(build_options)
+  if(CMAKE_TEST_MAKEPROGRAM)
+    list(APPEND build_options -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_TEST_MAKEPROGRAM})
+  endif()
 
   add_subdirectory(CMakeLib)
   add_subdirectory(CMakeOnly)
@@ -254,6 +256,7 @@ if(BUILD_TESTING)
   ADD_TEST_MACRO(Assembler HelloAsm)
   ADD_TEST_MACRO(SourceGroups SourceGroups)
   ADD_TEST_MACRO(Preprocess Preprocess)
+  set(ExportImport_BUILD_OPTIONS -DCMAKE_TEST_MAKEPROGRAM:FILEPATH=${CMAKE_TEST_MAKEPROGRAM})
   ADD_TEST_MACRO(ExportImport ExportImport)
   ADD_TEST_MACRO(Unset Unset)
   ADD_TEST_MACRO(PolicyScope PolicyScope)
@@ -465,7 +468,6 @@ if(BUILD_TESTING)
          --build-two-config
          --build-generator "Eclipse CDT4 - Unix Makefiles"
          --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}"
-         --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
          --build-project Simple
          --build-options ${build_options}
          --test-command Simple)
@@ -481,7 +483,6 @@ if(BUILD_TESTING)
          --build-two-config
          --build-generator "CodeBlocks - Unix Makefiles"
          --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}"
-         --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
          --build-project Simple
          --build-options ${build_options}
          --test-command Simple)
@@ -496,7 +497,6 @@ if(BUILD_TESTING)
          --build-two-config
          --build-generator "KDevelop3 - Unix Makefiles"
          --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}"
-         --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
          --build-project Simple
          --build-options ${build_options}
          --test-command Simple)
@@ -1352,6 +1352,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       ${build_generator_args}
       --build-project MacRuntimePath
       --build-options ${build_options}
+        -DCMAKE_TEST_MAKEPROGRAM:FILEPATH=${CMAKE_TEST_MAKEPROGRAM}
       )
   endif()
 
@@ -2504,6 +2505,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-project testf
       --build-two-config
       --build-options ${build_options}
+        -DCMAKE_TEST_MAKEPROGRAM:FILEPATH=${CMAKE_TEST_MAKEPROGRAM}
       --test-command testf)
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Fortran")
 
diff --git a/Tests/ExportImport/CMakeLists.txt b/Tests/ExportImport/CMakeLists.txt
index b8368fc..8be8d33 100644
--- a/Tests/ExportImport/CMakeLists.txt
+++ b/Tests/ExportImport/CMakeLists.txt
@@ -42,7 +42,6 @@ add_custom_command(
     --build-target install
     --build-generator ${CMAKE_GENERATOR}
     --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
-    --build-makeprogram ${CMAKE_MAKE_PROGRAM}
     --build-options -C${ExportImport_BINARY_DIR}/InitialCache.cmake
   VERBATIM
   )
@@ -64,7 +63,6 @@ add_custom_command(
    --build-project Import
    --build-generator ${CMAKE_GENERATOR}
    --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
-   --build-makeprogram ${CMAKE_MAKE_PROGRAM}
    --build-options -C${ExportImport_BINARY_DIR}/InitialCache.cmake
   VERBATIM
   )
diff --git a/Tests/ExportImport/InitialCache.cmake.in b/Tests/ExportImport/InitialCache.cmake.in
index 98d355f..fba6ee2 100644
--- a/Tests/ExportImport/InitialCache.cmake.in
+++ b/Tests/ExportImport/InitialCache.cmake.in
@@ -1,3 +1,4 @@
+set(CMAKE_MAKE_PROGRAM "@CMAKE_TEST_MAKEPROGRAM@" CACHE FILEPATH "Make Program")
 set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@" CACHE STRING "C Compiler")
 set(CMAKE_C_FLAGS "@CMAKE_C_FLAGS@" CACHE STRING "C Flags")
 set(CMAKE_C_FLAGS_DEBUG "@CMAKE_C_FLAGS_DEBUG@" CACHE STRING "C Flags")
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt
index cda5fed..8f165ce 100644
--- a/Tests/Fortran/CMakeLists.txt
+++ b/Tests/Fortran/CMakeLists.txt
@@ -198,13 +198,13 @@ if(TEST_MODULE_DEPENDS)
          --build-project ExtFort
          --build-generator ${CMAKE_GENERATOR}
          --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
-         --build-makeprogram ${CMAKE_MAKE_PROGRAM}
          --build-options -DCMAKE_Fortran_COMPILER:STRING=${CMAKE_Fortran_COMPILER}
                          -DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS}
                          -DCMAKE_Fortran_FLAGS_DEBUG:STRING=${CMAKE_Fortran_FLAGS_DEBUG}
                          -DCMAKE_Fortran_FLAGS_RELEASE:STRING=${CMAKE_Fortran_FLAGS_RELEASE}
                          -DCMAKE_Fortran_FLAGS_MINSIZEREL:STRING=${CMAKE_Fortran_FLAGS_MINSIZEREL}
                          -DCMAKE_Fortran_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_Fortran_FLAGS_RELWITHDEBINFO}
+                         -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_TEST_MAKEPROGRAM}
                          ${External_BUILD_TYPE}
     VERBATIM
     )
diff --git a/Tests/MacRuntimePath/CMakeLists.txt b/Tests/MacRuntimePath/CMakeLists.txt
index 5e5b6c4..a87b41e 100644
--- a/Tests/MacRuntimePath/CMakeLists.txt
+++ b/Tests/MacRuntimePath/CMakeLists.txt
@@ -38,7 +38,6 @@ add_custom_command(
     --build-target install
     --build-generator ${CMAKE_GENERATOR}
     --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
-    --build-makeprogram ${CMAKE_MAKE_PROGRAM}
     --build-options -C${MacRuntimePath_BINARY_DIR}/InitialCache.cmake
   VERBATIM
   )
@@ -60,7 +59,6 @@ add_custom_command(
    --build-project MacRuntimePath_B
    --build-generator ${CMAKE_GENERATOR}
    --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
-   --build-makeprogram ${CMAKE_MAKE_PROGRAM}
    --build-options -C${MacRuntimePath_BINARY_DIR}/InitialCache.cmake
   VERBATIM
   )
diff --git a/Tests/MacRuntimePath/InitialCache.cmake.in b/Tests/MacRuntimePath/InitialCache.cmake.in
index be15eb3..3dc9041 100644
--- a/Tests/MacRuntimePath/InitialCache.cmake.in
+++ b/Tests/MacRuntimePath/InitialCache.cmake.in
@@ -1,3 +1,4 @@
+set(CMAKE_MAKE_PROGRAM "@CMAKE_TEST_MAKEPROGRAM@" CACHE FILEPATH "Make Program")
 set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@" CACHE STRING "C Compiler")
 set(CMAKE_C_FLAGS "@CMAKE_C_FLAGS@" CACHE STRING "C Flags")
 set(CMAKE_C_FLAGS_DEBUG "@CMAKE_C_FLAGS_DEBUG@" CACHE STRING "C Flags")

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=68031abf15affedc72c13b8b7f1ff025f510bd20
commit 68031abf15affedc72c13b8b7f1ff025f510bd20
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Nov 15 10:33:04 2013 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Nov 18 11:30:50 2013 -0500

    Tests: Configure SubProject-Stage2 test more robustly
    
    Fix the condition that adds the test to check CMAKE_TEST_GENERATOR
    rather than the tools used to build CMake.  Drop the test on Ninja
    because the generator does not support subproject generation anyway.
    Stop using the general build_generator_args and pass the
    --build-generator options explicitly.  Also pass --build-makeprogram
    explicitly when CMAKE_TEST_MAKEPROGRAM is available because there is no
    CMakeCache.txt in the test project subdirectory from which to pick up
    the make program.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 59aa59f..43ae52a 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -506,8 +506,8 @@ if(BUILD_TESTING)
   endif()
 
   # test for correct sub-project generation
-  # not implemented in VS6 or Xcode
-  if(NOT MSVC60 AND NOT XCODE AND NOT MSVC70)
+  # not implemented in VS 6, VS 7.0, Xcode, or Ninja
+  if(NOT CMAKE_TEST_GENERATOR MATCHES "Visual Studio [67]$|Xcode|Ninja")
     # run cmake and configure all of SubProject
     # but only build the independent executable car
     add_test(SubProject ${CMAKE_CTEST_COMMAND}
@@ -521,24 +521,23 @@ if(BUILD_TESTING)
       --test-command car
       )
 
-    if(${CMAKE_TEST_GENERATOR} MATCHES "Ninja")
-      # The Ninja generator does not create a recursive build system.  Start
-      # from the root directory.
-      set(SubProject_SUBDIR)
-    else()
-      set(SubProject_SUBDIR "/foo")
-    endif()
-
     # For stage 2, do not run cmake again.
     # Then build the foo sub project which should build
     # the bar library which should be referenced because
     # foo links to the static library bar, but bar is not
     # directly in the foo sub project
+    if(CMAKE_TEST_MAKEPROGRAM)
+      set(SubProject-Stage2_BUILD_MAKEPROGRAM
+        --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+        )
+    endif()
     add_test(SubProject-Stage2  ${CMAKE_CTEST_COMMAND}
       --build-and-test
-      "${CMake_SOURCE_DIR}/Tests/SubProject${SubProject_SUBDIR}"
-      "${CMake_BINARY_DIR}/Tests/SubProject${SubProject_SUBDIR}"
-      ${build_generator_args}
+      "${CMake_SOURCE_DIR}/Tests/SubProject/foo"
+      "${CMake_BINARY_DIR}/Tests/SubProject/foo"
+      --build-generator ${CMAKE_TEST_GENERATOR}
+      --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}"
+      ${SubProject-Stage2_BUILD_MAKEPROGRAM}
       --build-nocmake
       --build-project foo
       --build-target foo

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=003d10c248f3f55cea7885ac83300777d687c8a5
commit 003d10c248f3f55cea7885ac83300777d687c8a5
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Nov 14 14:27:46 2013 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Nov 18 11:30:49 2013 -0500

    Tests: Simplify VSExcludeFromDefaultBuild configuration
    
    Create a CTEST_TEST_DEVENV variable that is set to the
    CMAKE_MAKE_PROGRAM used for Visual Studio 7, 8, and 9.  It will always
    be either "devenv" or "VCExpress", and not "MSBuild".  Add the
    VSExcludeFromDefaultBuild test only when this variable is set, and use
    its value as the --build-makeprogram value.
    
    More work will be needed later to restore the test on VS 10 and above
    when devenv is available, but this is the simplest approach for now.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index fc2d8a4..59aa59f 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -45,8 +45,13 @@ configure_file(${CMake_SOURCE_DIR}/Tests/EnforceConfig.cmake.in
 
 # Testing
 if(BUILD_TESTING)
+  set(CMAKE_TEST_DEVENV "")
   if(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
     set(CMAKE_TEST_MAKEPROGRAM "${CMAKE_MAKE_PROGRAM}")
+    if(CMAKE_TEST_GENERATOR MATCHES "Visual Studio [7-9] " AND
+        NOT CMAKE_MAKE_PROGRAM MATCHES "[mM][sS][bB][uU][iI][lL][dD]\\.[eE][xX][eE]")
+      set(CMAKE_TEST_DEVENV "${CMAKE_MAKE_PROGRAM}")
+    endif()
   endif()
 
   if("${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles" OR ("${CMAKE_TEST_GENERATOR}" MATCHES Ninja AND NOT WIN32))
@@ -1616,7 +1621,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --test-command VSMidl)
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSMidl")
 
-    if(NOT MSVC60 AND NOT CMAKE_TEST_MAKEPROGRAM MATCHES "[mM][sS][bB][uU][iI][lL][dD]\\.[eE][xX][eE]")
+    if(CMAKE_TEST_DEVENV)
       # The test (and tested property) works with .sln files, so it's skipped when:
       # * Using VS6, which doesn't use .sln files
       # * cmake --build is set up to use MSBuild, since the MSBuild invocation does not use the .sln file
@@ -1628,7 +1633,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
           "${CMake_BINARY_DIR}/Tests/VSExcludeFromDefaultBuild"
           --build-config ${config}
           --build-two-config
-          ${build_generator_args}
+          --build-generator ${CMAKE_TEST_GENERATOR}
+          --build-makeprogram ${CMAKE_TEST_DEVENV}
+          --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}"
           --build-project VSExcludeFromDefaultBuild
           --test-command ${CMAKE_COMMAND}
              -D "activeConfig=${config}"

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e47d934a5a2da9f7589c801c2c232a650e2c797e
commit e47d934a5a2da9f7589c801c2c232a650e2c797e
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Nov 14 14:21:40 2013 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Nov 18 11:30:49 2013 -0500

    Tests: Simplify VSProjectInSubdir configuration
    
    The test is only enabled on VS 10 and above, where the generators now
    select for "ctest --build-and-test" the MSBuild tool by default.
    Simplify the test configuration by dropping the --build-makeprogram
    option and all the logic needed to compute its value.  The test will
    automatically use MSBuild.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index e618f14..fc2d8a4 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1645,31 +1645,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     endif()
 
     if(CMAKE_TEST_GENERATOR MATCHES "Visual Studio ([0-5]|[6-9][0-9])")
-      if(CMAKE_TEST_MAKEPROGRAM MATCHES "[mM][sS][bB][uU][iI][lL][dD]\\.[eE][xX][eE]")
-        set(MSBUILD_EXECUTABLE "${CMAKE_TEST_MAKEPROGRAM}")
-      else()
-        if(CMAKE_TEST_GENERATOR MATCHES "Visual Studio (12)")
-          set(_msbuild_hints "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\${CMAKE_MATCH_1}.0;MSBuildToolsPath]")
-        else()
-          set(_FDIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;FrameworkDir32]")
-          set(_FVER "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;FrameworkVer32]")
-          set(_msbuild_hints ${_FDIR}/${_FVER})
-        endif()
-        find_program(MSBUILD_EXECUTABLE NAMES msbuild HINTS ${_msbuild_hints})
-      endif()
-      if(MSBUILD_EXECUTABLE)
-        add_test(NAME VSProjectInSubdir COMMAND ${CMAKE_CTEST_COMMAND}
-          --build-and-test
-          "${CMake_SOURCE_DIR}/Tests/VSProjectInSubdir"
-          "${CMake_BINARY_DIR}/Tests/VSProjectInSubdir"
-          --build-two-config
-          --build-generator ${CMAKE_TEST_GENERATOR}
-          --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}"
-          --build-makeprogram "${MSBUILD_EXECUTABLE}"
-          --build-project VSProjectInSubdir
-          --build-target test)
-        list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSProjectInSubdir")
-      endif()
+      # This is Visual Studio 10 or above, so the default build tool is MSBuild.
+      add_test(NAME VSProjectInSubdir COMMAND ${CMAKE_CTEST_COMMAND}
+        --build-and-test
+        "${CMake_SOURCE_DIR}/Tests/VSProjectInSubdir"
+        "${CMake_BINARY_DIR}/Tests/VSProjectInSubdir"
+        --build-two-config
+        --build-generator ${CMAKE_TEST_GENERATOR}
+        --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}"
+        --build-project VSProjectInSubdir
+        --build-target test)
+      list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSProjectInSubdir")
     endif()
   endif()
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e965cb12e2083d6b869fb30fabe7e290e6094908
commit e965cb12e2083d6b869fb30fabe7e290e6094908
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Nov 14 13:32:39 2013 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Nov 18 11:30:49 2013 -0500

    Tests: Simplify CTest.BuildCommand.ProjectInSubdir configuration
    
    Collect all ctest_configure options in a list to configure it into the
    test script.  Drop the unused -DCMAKE_MAKE_PROGRAM argument to ctest.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index cd4a843..e618f14 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1829,17 +1829,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
 #        )
 
   # A test for ctest_build() with targets in subdirectories
+  set(ctest_configure_options)
   if(CMAKE_TEST_GENERATOR_TOOLSET)
-    set(CMAKE_TEST_GENERATOR_TOOLSET_SELECTION "-T;${CMAKE_TEST_GENERATOR_TOOLSET};")
-  else()
-    set(CMAKE_TEST_GENERATOR_TOOLSET_SELECTION)
+    list(APPEND ctest_configure_options -T ${CMAKE_TEST_GENERATOR_TOOLSET})
+  endif()
+  if(CMAKE_TEST_MAKEPROGRAM)
+    list(APPEND ctest_configure_options -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_TEST_MAKEPROGRAM})
   endif()
   configure_file("${CMake_SOURCE_DIR}/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in"
                  "${CMake_BINARY_DIR}/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake" @ONLY)
-  unset(CMAKE_TEST_GENERATOR_TOOLSET_SELECTION)
+  unset(ctest_configure_options)
   add_test(CTest.BuildCommand.ProjectInSubdir
-    ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake"
-                           -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_TEST_MAKEPROGRAM})
+    ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake")
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CTestBuildCommandProjectInSubdir/Nested")
 
   set(CTEST_TEST_UPDATE 1)
diff --git a/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in b/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in
index ea48c78..abf010b 100644
--- a/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in
+++ b/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in
@@ -8,5 +8,5 @@ set(CTEST_BUILD_CONFIGURATION "@CTestTest_CONFIG@")
 
 ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
 ctest_start(Experimental)
-ctest_configure(OPTIONS "@CMAKE_TEST_GENERATOR_TOOLSET_SELECTION at -DCMAKE_MAKE_PROGRAM:FILEPATH=@CMAKE_TEST_MAKEPROGRAM@")
+ctest_configure(OPTIONS "@ctest_configure_options@")
 ctest_build(TARGET test)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=72bf2552f2c750bc52b9e2cc3f85320d6452c3a4
commit 72bf2552f2c750bc52b9e2cc3f85320d6452c3a4
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Nov 15 09:12:55 2013 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Nov 18 11:30:49 2013 -0500

    Tests: Pass --build-options to every test
    
    Create a "build_options" variable whose value is passed to every
    "ctest --build-and-test" call through the --build-options argument.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index b0aaf17..cd4a843 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -11,7 +11,7 @@ macro(ADD_TEST_MACRO NAME COMMAND)
     ${build_generator_args}
     --build-project ${proj}
     ${${NAME}_CTEST_OPTIONS}
-    --build-options
+    --build-options ${build_options}
     ${${NAME}_BUILD_OPTIONS}
     --test-command ${COMMAND} ${ARGN})
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}")
@@ -83,6 +83,8 @@ if(BUILD_TESTING)
       )
   endif()
 
+  set(build_options)
+
   add_subdirectory(CMakeLib)
   add_subdirectory(CMakeOnly)
   add_subdirectory(RunCMake)
@@ -282,6 +284,7 @@ if(BUILD_TESTING)
       --build-two-config
       ${build_generator_args}
       --build-project InterfaceBuildTargets
+      --build-options ${build_options}
       --test-command ${CMAKE_CMAKE_COMMAND} -E touch_nocreate ${InterfaceBuildTargets_libname}
       )
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/InterfaceBuildTargets")
@@ -325,6 +328,7 @@ if(BUILD_TESTING)
       "${CMake_BINARY_DIR}/Tests/BundleUtilities"
       ${build_generator_args}
       --build-project BundleUtilities
+      --build-options ${build_options}
       )
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleUtilities")
 
@@ -337,7 +341,7 @@ if(BUILD_TESTING)
         "${CMake_BINARY_DIR}/Tests/Qt4Deploy"
         ${build_generator_args}
         --build-project Qt4Deploy
-        --build-options
+        --build-options ${build_options}
         -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
         -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
         )
@@ -375,7 +379,8 @@ if(BUILD_TESTING)
     --build-project ExternalDataTest
     --build-noclean
     --force-new-ctest-process
-    --build-options -DMAKE_SUPPORTS_SPACES=${MAKE_SUPPORTS_SPACES}
+    --build-options ${build_options}
+      -DMAKE_SUPPORTS_SPACES=${MAKE_SUPPORTS_SPACES}
     --test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} -V
     )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Module/ExternalData")
@@ -408,7 +413,8 @@ if(BUILD_TESTING)
     ${build_generator_args}
     --build-project LinkFlags
     --build-target LinkFlags
-    --build-options -DTEST_CONFIG=\${CTEST_CONFIGURATION_TYPE}
+    --build-options ${build_options}
+      -DTEST_CONFIG=\${CTEST_CONFIGURATION_TYPE}
     )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkFlags")
 
@@ -456,6 +462,7 @@ if(BUILD_TESTING)
          --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}"
          --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
          --build-project Simple
+         --build-options ${build_options}
          --test-command Simple)
       list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator")
     endif ()
@@ -471,6 +478,7 @@ if(BUILD_TESTING)
          --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}"
          --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
          --build-project Simple
+         --build-options ${build_options}
          --test-command Simple)
       list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator")
     endif ()
@@ -485,6 +493,7 @@ if(BUILD_TESTING)
          --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}"
          --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
          --build-project Simple
+         --build-options ${build_options}
          --test-command Simple)
       list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator")
     endif ()
@@ -503,6 +512,7 @@ if(BUILD_TESTING)
       --build-project SubProject
       ${build_generator_args}
       --build-target car
+      --build-options ${build_options}
       --test-command car
       )
 
@@ -528,6 +538,7 @@ if(BUILD_TESTING)
       --build-project foo
       --build-target foo
       --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubProject/foo"
+      --build-options ${build_options}
       --test-command foo
       )
     set_tests_properties ( SubProject-Stage2 PROPERTIES DEPENDS SubProject)
@@ -568,7 +579,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-two-config
     ${build_generator_args}
     --build-project Framework
-    --build-options
+    --build-options ${build_options}
     "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/Framework/Install"
     --test-command bar)
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Framework")
@@ -580,6 +591,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-two-config
     ${build_generator_args}
     --build-project TargetName
+    --build-options ${build_options}
     --test-command ${CMAKE_CMAKE_COMMAND} -E compare_files
     ${CMake_SOURCE_DIR}/Tests/TargetName/scripts/hello_world
     ${CMake_BINARY_DIR}/Tests/TargetName/scripts/hello_world)
@@ -593,6 +605,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     ${build_generator_args}
     --build-project LibName
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/LibName/lib"
+    --build-options ${build_options}
     --test-command foobar
     )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LibName")
@@ -605,6 +618,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     ${build_generator_args}
     --build-project CustComDepend
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustComDepend/bin"
+    --build-options ${build_options}
     --test-command foo bar.c
     )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustComDepend")
@@ -616,6 +630,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     ${build_generator_args}
     --build-project ArgumentExpansion
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/ArgumentExpansion/bin"
+    --build-options ${build_options}
     )
   set_tests_properties(ArgumentExpansion PROPERTIES
     FAIL_REGULAR_EXPRESSION "Unexpected: ")
@@ -627,7 +642,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     "${CMake_BINARY_DIR}/Tests/GeneratorExpression"
     ${build_generator_args}
     --build-project GeneratorExpression
-    --build-options -DCMAKE_BUILD_TYPE=\${CTEST_CONFIGURATION_TYPE}
+    --build-options ${build_options}
+      -DCMAKE_BUILD_TYPE=\${CTEST_CONFIGURATION_TYPE}
     --test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} -V
     )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/GeneratorExpression")
@@ -640,6 +656,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     ${build_generator_args}
     --build-project CustomCommand
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustomCommand/bin"
+    --build-options ${build_options}
     --test-command CustomCommand
     )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommand")
@@ -653,6 +670,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-two-config
     ${build_generator_args}
     --build-project TestWorkingDir
+    --build-options ${build_options}
     --test-command working
     )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory")
@@ -664,6 +682,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
    #  ${build_generator_args}
    #  --build-project SimpleExclude
    #  --build-two-config
+   #  --build-options ${build_options}
    #  --test-command t4
    #--test-command "${CMAKE_COMMAND}"
    #"-DCONFIGURATION=\${CTEST_CONFIGURATION_TYPE}"
@@ -677,6 +696,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
 #    ${build_generator_args}
 #    --build-project SameName
 #    --build-two-config
+#    --build-options ${build_options}
 #    --test-command
 #    "${CMake_BINARY_DIR}/Tests/SameName/Exe1/mytest2")
 
@@ -687,6 +707,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     ${build_generator_args}
     --build-project OutOfSource
     --build-two-config
+    --build-options ${build_options}
     --test-command
     "${CMake_BINARY_DIR}/Tests/OutOfSource/SubDir/OutOfSourceSubdir/simple")
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfSource")
@@ -699,6 +720,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     "${CMake_BINARY_DIR}/Tests/BuildDepends"
     ${build_generator_args}
     --build-project BuildDepends
+    --build-options ${build_options}
     )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BuildDepends")
 
@@ -711,7 +733,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     ${build_generator_args}
     --build-project TestSimpleInstall
     --build-two-config
-    --build-options
+    --build-options ${build_options}
     "-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}"
     "-DCTEST_TEST_CPACK:BOOL=${CTEST_TEST_CPACK}"
     --test-command   ${SimpleInstallInstallDir}/MyTest/bin/SimpleInstExe)
@@ -723,7 +745,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     ${build_generator_args}
     --build-project TestSimpleInstall
     --build-two-config
-    --build-options
+    --build-options ${build_options}
     "-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}"
     "-DSTAGE2:BOOL=1"
     --test-command   ${SimpleInstallInstallDir}/MyTest/bin/SimpleInstExeS2)
@@ -777,6 +799,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         "${CMake_BINARY_DIR}/Tests/CPackWiXGenerator"
         ${build_generator_args}
         --build-project CPackWiXGenerator
+        --build-options ${build_options}
         --test-command ${CMAKE_CMAKE_COMMAND}
           "-DCPackWiXGenerator_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackWiXGenerator"
           -P "${CMake_SOURCE_DIR}/Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake")
@@ -801,7 +824,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-project CPackComponents
       --build-two-config
       --build-target package
-      --build-options
+      --build-options ${build_options}
         -DCPACK_BINARY_DEB:BOOL=${CPACK_BINARY_DEB}
         -DCPACK_BINARY_RPM:BOOL=${CPACK_BINARY_RPM}
         ${CPackComponents_BUILD_OPTIONS}
@@ -860,7 +883,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
           "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}"
           ${build_generator_args}
           --build-project CPackComponentsForAll
-          --build-options
+          --build-options ${build_options}
              -DCPACK_BINARY_${CPackGen}:BOOL=ON
              ${CPackRun_CPackComponentWay}
              ${CPackComponentsForAll_BUILD_OPTIONS}
@@ -897,6 +920,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       "${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators"
       ${build_generator_args}
       --build-project CPackTestAllGenerators
+      --build-options ${build_options}
       --test-command
       ${CMAKE_CMAKE_COMMAND}
         -D dir=${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators
@@ -919,6 +943,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-project UseX11
     --build-two-config
     ${X11_build_target_arg}
+    --build-options ${build_options}
     --test-command  UseX11)
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/X11")
 
@@ -972,6 +997,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig"
     ${build_generator_args}
     --build-project LoadCommand
+    --build-options ${build_options}
     --test-command  LoadedCommand
     )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig")
@@ -985,7 +1011,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     ${build_generator_args}
     --build-project Complex
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/Complex/bin"
-    --build-options
+    --build-options ${build_options}
     -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
     --test-command complex
     )
@@ -998,7 +1024,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     ${build_generator_args}
     --build-project Complex
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexOneConfig/bin"
-    --build-options
+    --build-options ${build_options}
     -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
     --test-command complex)
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ComplexOneConfig")
@@ -1012,6 +1038,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     ${build_generator_args}
     --build-project HELLO
     --build-exe-dir "${CMake_BINARY_DIR}/Example/Demo"
+    --build-options ${build_options}
     --test-command helloDemo
     )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Example")
@@ -1024,6 +1051,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-project EnvironmentProj
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/Environment"
     --force-new-ctest-process
+    --build-options ${build_options}
     --test-command ${CMAKE_CTEST_COMMAND} -V
     )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Environment")
@@ -1034,7 +1062,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     "${CMake_BINARY_DIR}/Tests/QtAutomocNoQt"
     ${build_generator_args}
     --build-project QtAutomocNoQt
-    --build-options -DCMAKE_BUILD_TYPE=\${CTEST_CONFIGURATION_TYPE}
+    --build-options ${build_options}
+      -DCMAKE_BUILD_TYPE=\${CTEST_CONFIGURATION_TYPE}
     )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomocNoQt")
 
@@ -1057,7 +1086,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-project QtAutogen
       --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt5Autogen"
       --force-new-ctest-process
-      --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=5
+      --build-options ${build_options}
+        -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=5
       --test-command ${run_autogen_test}
       )
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt5Autogen")
@@ -1071,7 +1101,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-project QtAutogen
       --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4Autogen"
       --force-new-ctest-process
-      --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=4
+      --build-options ${build_options}
+        -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=4
       --test-command ${run_autogen_test}
       )
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Autogen")
@@ -1084,7 +1115,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-project Qt4Targets
       --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4Targets"
       --force-new-ctest-process
-      --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
+      --build-options ${build_options}
+        -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
       --test-command ${CMAKE_CTEST_COMMAND} -V
       )
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Targets")
@@ -1098,6 +1130,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         --build-project Qt4And5Automoc
         --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4And5Automoc"
         --force-new-ctest-process
+        --build-options ${build_options}
         --test-command ${CMAKE_CTEST_COMMAND} -V
         )
       list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4And5Automoc")
@@ -1117,6 +1150,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-project ExternalProjectTest
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/ExternalProject"
     --force-new-ctest-process
+    --build-options ${build_options}
     --test-command ${CMAKE_CTEST_COMMAND} -V
     )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProject")
@@ -1131,6 +1165,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-project ExternalProjectUpdateTest
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate"
     --force-new-ctest-process
+    --build-options ${build_options}
     --test-command ${CMAKE_CTEST_COMMAND} -V
     )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate")
@@ -1161,6 +1196,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-two-config
       ${build_generator_args}
       --build-project Tutorial
+      --build-options ${build_options}
       --test-command Tutorial 25.0)
   endforeach()
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Tutorial")
@@ -1171,6 +1207,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     "${CMake_BINARY_DIR}/Tests/Testing"
     ${build_generator_args}
     --build-project Testing
+    --build-options ${build_options}
     --test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
     )
   set_tests_properties(testing PROPERTIES PASS_REGULAR_EXPRESSION "Passed")
@@ -1183,6 +1220,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     ${build_generator_args}
     --build-project Wrapping
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
+    --build-options ${build_options}
     --test-command wrapping
     )
   add_test(qtwrapping  ${CMAKE_CTEST_COMMAND}
@@ -1192,6 +1230,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     ${build_generator_args}
     --build-project Wrapping
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
+    --build-options ${build_options}
       --test-command qtwrapping
       )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Wrapping")
@@ -1203,6 +1242,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     ${build_generator_args}
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
     --build-project TestDriverTest
+    --build-options ${build_options}
     --test-command TestDriverTest test1
     )
 
@@ -1213,6 +1253,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     ${build_generator_args}
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
     --build-project TestDriverTest
+    --build-options ${build_options}
     --test-command TestDriverTest test2
     )
 
@@ -1223,6 +1264,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     ${build_generator_args}
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
     --build-project TestDriverTest
+    --build-options ${build_options}
     --test-command TestDriverTest subdir/test3
     )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver")
@@ -1234,6 +1276,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/Exec"
     ${build_generator_args}
     --build-project Dependency
+    --build-options ${build_options}
     --test-command exec
     )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Dependency")
@@ -1263,7 +1306,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-exe-dir "${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Executable"
       --build-project Jump
       ${build_generator_args}
-      --build-options
+      --build-options ${build_options}
       -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Lib
       --test-command jumpExecutable
       )
@@ -1276,6 +1319,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-run-dir "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut/Executable"
       --build-project Jump
       ${build_generator_args}
+      --build-options ${build_options}
       --test-command jumpExecutable
       )
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Jump")
@@ -1287,6 +1331,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       ${build_generator_args}
       --build-project Plugin
       --build-two-config
+      --build-options ${build_options}
       --test-command bin/example)
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Plugin")
 
@@ -1302,6 +1347,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       "${CMake_BINARY_DIR}/Tests/MacRuntimePath"
       ${build_generator_args}
       --build-project MacRuntimePath
+      --build-options ${build_options}
       )
   endif()
 
@@ -1311,6 +1357,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     "${CMake_BINARY_DIR}/Tests/LinkLineOrder"
     ${build_generator_args}
     --build-project LinkLineOrder
+    --build-options ${build_options}
     --test-command Exec1
     )
 
@@ -1320,6 +1367,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     "${CMake_BINARY_DIR}/Tests/LinkLineOrder"
     ${build_generator_args}
     --build-project LinkLineOrder
+    --build-options ${build_options}
     --test-command Exec2
     )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkLineOrder")
@@ -1340,7 +1388,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       "${CMake_BINARY_DIR}/Tests/LinkStatic"
       ${build_generator_args}
       --build-project LinkStatic
-      --build-options -DMATH_LIBRARY:FILEPATH=/usr/lib/libm.a
+      --build-options ${build_options}
+        -DMATH_LIBRARY:FILEPATH=/usr/lib/libm.a
       --test-command LinkStatic
       )
   endif()
@@ -1352,6 +1401,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       "${CMake_BINARY_DIR}/Tests/kwsys"
       ${build_generator_args}
       --build-project kwsys
+      --build-options ${build_options}
       --test-command kwsysTestsCxx testIOS
       )
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/kwsys")
@@ -1366,6 +1416,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       "${CMake_BINARY_DIR}/Tests/SubDirSpaces/Executable Sources"
       ${build_generator_args}
       --build-project SUBDIR
+      --build-options ${build_options}
       --test-command test
       "${CMake_BINARY_DIR}/Tests/SubDirSpaces/ShouldBeHere"
       "${CMake_BINARY_DIR}/Tests/SubDirSpaces/testfromsubdir.obj"
@@ -1381,6 +1432,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable"
       ${build_generator_args}
       --build-project SUBDIR
+      --build-options ${build_options}
       --test-command test
       "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere"
       "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.obj"
@@ -1393,6 +1445,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable"
       ${build_generator_args}
       --build-project SUBDIR
+      --build-options ${build_options}
       --test-command test
       "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere"
       "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.o"
@@ -1420,6 +1473,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       ${build_generator_args}
       --build-project MakeClean
       --build-exe-dir "${CMake_BINARY_DIR}/MakeClean"
+      --build-options ${build_options}
       --test-command check_clean
       )
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MakeClean")
@@ -1524,6 +1578,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-two-config
       ${build_generator_args}
       --build-project mfc_driver
+      --build-options ${build_options}
       --test-command ${CMAKE_CTEST_COMMAND}
         -C \${CTEST_CONFIGURATION_TYPE} -VV)
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MFC")
@@ -1546,6 +1601,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-two-config
       ${build_generator_args}
       --build-project VSExternalInclude
+      --build-options ${build_options}
       --test-command VSExternalInclude)
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSExternalInclude")
 
@@ -1556,6 +1612,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-two-config
       ${build_generator_args}
       --build-project VSMidl
+      --build-options ${build_options}
       --test-command VSMidl)
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSMidl")
 
@@ -1629,7 +1686,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         --build-project BundleTest
         --build-target install
 #       --build-target package
-        --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${BundleTestInstallDir}"
+        --build-options ${build_options}
+        "-DCMAKE_INSTALL_PREFIX:PATH=${BundleTestInstallDir}"
         "-DCMake_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}"
         --test-command
         ${BundleTestInstallDir}/Applications/SecondBundleExe.app/Contents/MacOS/SecondBundleExe)
@@ -1642,6 +1700,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         --build-two-config
         ${build_generator_args}
         --build-project CFBundleTest
+        --build-options ${build_options}
         --test-command
         ${CMAKE_CMAKE_COMMAND} -DCTEST_CONFIGURATION_TYPE=\${CTEST_CONFIGURATION_TYPE}
         -Ddir=${CMake_BINARY_DIR}/Tests/CFBundleTest
@@ -1662,7 +1721,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       ${build_generator_args}
       --build-project BundleGeneratorTest
       --build-target package
-      --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/BundleGeneratorTest/InstallDirectory"
+      --build-options ${build_options}
+        "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/BundleGeneratorTest/InstallDirectory"
       )
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest")
   endif()
@@ -1674,7 +1734,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     ${build_generator_args}
     --build-noclean
     --build-project WarnUnusedUnusedViaSet
-    --build-options "--warn-unused-vars")
+    --build-options ${build_options}
+      "--warn-unused-vars")
   set_tests_properties(WarnUnusedUnusedViaSet PROPERTIES
     PASS_REGULAR_EXPRESSION "unused variable \\(changing definition\\) 'UNUSED_VARIABLE'")
   set_tests_properties(WarnUnusedUnusedViaSet PROPERTIES
@@ -1688,7 +1749,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     ${build_generator_args}
     --build-noclean
     --build-project WarnUnusedUnusedViaUnset
-    --build-options "--warn-unused-vars")
+    --build-options ${build_options}
+      "--warn-unused-vars")
   set_tests_properties(WarnUnusedUnusedViaUnset PROPERTIES
     PASS_REGULAR_EXPRESSION "CMake Warning .*VariableUnusedViaUnset.CMakeLists.txt:7 \\(set\\):")
   set_tests_properties(WarnUnusedUnusedViaUnset PROPERTIES
@@ -1707,7 +1769,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused"
       ${build_generator_args}
       --build-project WarnUnusedCliUnused
-      --build-options "-DUNUSED_CLI_VARIABLE=Unused")
+      --build-options ${build_options}
+        "-DUNUSED_CLI_VARIABLE=Unused")
     set_tests_properties(WarnUnusedCliUnused PROPERTIES
       PASS_REGULAR_EXPRESSION "CMake Warning:.*Manually-specified variables were not used by the project:.*  UNUSED_CLI_VARIABLE")
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused")
@@ -1720,7 +1783,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     ${build_generator_args}
     --build-noclean
     --build-project WarnUnusedCliUsed
-    --build-options "-DUSED_VARIABLE=Usage proven")
+    --build-options ${build_options}
+      "-DUSED_VARIABLE=Usage proven")
   set_tests_properties(WarnUnusedCliUsed PROPERTIES
     PASS_REGULAR_EXPRESSION "Usage proven")
   set_tests_properties(WarnUnusedCliUsed PROPERTIES
@@ -1734,7 +1798,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     ${build_generator_args}
     --build-noclean
     --build-project WarnUninitialized
-    --build-options "--warn-uninitialized")
+    --build-options ${build_options}
+      "--warn-uninitialized")
   set_tests_properties(WarnUninitialized PROPERTIES
     PASS_REGULAR_EXPRESSION "uninitialized variable 'USED_VARIABLE'")
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUninitialized")
@@ -1747,6 +1812,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-project TestsWorkingDirectoryProj
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory"
     --force-new-ctest-process
+    --build-options ${build_options}
     --test-command ${CMAKE_CTEST_COMMAND} -V -C \${CTEST_CONFIGURATION_TYPE}
     )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory")
@@ -2444,6 +2510,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       ${build_generator_args}
       --build-project testf
       --build-two-config
+      --build-options ${build_options}
       --test-command testf)
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Fortran")
 
@@ -2462,6 +2529,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         ${build_generator_args}
         --build-project FortranC
         --build-two-config
+        --build-options ${build_options}
         --test-command CMakeFiles/FortranCInterface/FortranCInterface)
       list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC")
     endif()
@@ -2485,6 +2553,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
           --build-project hello
           --build-two-config
           --build-run-dir "${CMake_BINARY_DIR}/Tests/Java/"
+          --build-options ${build_options}
           --test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld)
         list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Java")
       endif()
@@ -2504,7 +2573,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc"
         ${build_generator_args}
         --build-project SimpleC
-        --build-options
+        --build-options ${build_options}
         "-DCMAKE_SYSTEM_NAME=Generic"
         "-DCMAKE_C_COMPILER=${SDCC_EXECUTABLE}")
       list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc")
@@ -2522,7 +2591,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win"
         ${build_generator_args}
         --build-project Simple
-        --build-options
+        --build-options ${build_options}
         "-DCMAKE_SYSTEM_NAME=Windows"
         "-DCMAKE_C_COMPILER=${MINGW_CC_LINUX2WIN_EXECUTABLE}"
         "-DCMAKE_CXX_COMPILER=${MINGW_CXX_LINUX2WIN_EXECUTABLE}"
@@ -2616,6 +2685,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-two-config
     ${build_generator_args}
     --build-project IncludeDirectories
+    --build-options ${build_options}
     --test-command IncludeDirectories)
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/IncludeDirectories")
 
@@ -2626,6 +2696,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-two-config
     ${build_generator_args}
     --build-project InterfaceLinkLibraries
+    --build-options ${build_options}
     --test-command InterfaceLinkLibraries)
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/InterfaceLinkLibraries")
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4d1d7725f3e12399dd3785f5ffb7eae7db1be984
commit 4d1d7725f3e12399dd3785f5ffb7eae7db1be984
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Nov 15 08:28:25 2013 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Nov 18 11:30:49 2013 -0500

    ctest: Teach --build-options to allow zero options
    
    The --build-options option consumes all following arguments until either
    --build-target or --test-command.  Fix the logic to allow this to be
    zero options.

diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index 807a7e8..0fac136 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -513,23 +513,14 @@ int cmCTestBuildAndTestHandler::ProcessCommandLineArguments(
     {
     this->BuildNoClean = true;
     }
-  if(currentArg.find("--build-options",0) == 0 && idx < allArgs.size() - 1)
+  if(currentArg.find("--build-options",0) == 0)
     {
-    ++idx;
-    bool done = false;
-    while(idx < allArgs.size() && !done)
+    while(idx+1 < allArgs.size() &&
+          allArgs[idx+1] != "--build-target" &&
+          allArgs[idx+1] != "--test-command")
       {
+      ++idx;
       this->BuildOptions.push_back(allArgs[idx]);
-      if(idx+1 < allArgs.size()
-         && (allArgs[idx+1] == "--build-target" ||
-             allArgs[idx+1] == "--test-command"))
-        {
-        done = true;
-        }
-      else
-        {
-        ++idx;
-        }
       }
     }
   if(currentArg.find("--test-command",0) == 0 && idx < allArgs.size() - 1)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=96966b5c804a95677e43e3938c52afbd42b5d48a
commit 96966b5c804a95677e43e3938c52afbd42b5d48a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Nov 14 10:14:35 2013 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Nov 18 11:30:49 2013 -0500

    ctest: Make the --build-makeprogram optional for --build-and-test
    
    GenerateBuildCommand now knows how to lookup CMAKE_MAKE_PROGRAM or
    choose a generator-provided default build tool.  Therefore the
    --build-makeprogram can now be optional and simply override the
    default selection when provided.
    
    Note that with --build-nocmake we now need to load the cache in order to
    make the CMAKE_MAKE_PROGRAM entry available to GenerateBuildCommand.

diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index eee12fd..60d08dd 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -225,8 +225,8 @@ Options
  and or execute a test.  The configure and test steps are optional.
  The arguments to this command line are the source and binary
  directories.  By default this will run CMake on the Source/Bin
- directories specified unless --build-nocmake is specified.  Both
- --build-makeprogram and --build-generator MUST be provided to use
+ directories specified unless --build-nocmake is specified.
+ The --build-generator option *must* be provided to use
  --build-and-test.  If --test-command is specified then that will be
  run after the build is complete.  Other options that affect this
  mode are --build-target --build-nocmake, --build-run-dir,
@@ -265,7 +265,7 @@ Options
  Specify the name of the project to build.
 
 ``--build-makeprogram``
- Specify the make program to use.
+ Override the make program chosen by CTest with a given one.
 
 ``--build-noclean``
  Skip the make clean step.
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index 5e53dbe..807a7e8 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -18,6 +18,7 @@
 #include "cmGlobalGenerator.h"
 #include <cmsys/Process.h>
 #include "cmCTestTestHandler.h"
+#include "cmCacheManager.h"
 
 //----------------------------------------------------------------------
 cmCTestBuildAndTestHandler::cmCTestBuildAndTestHandler()
@@ -184,14 +185,14 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
   cmOStringStream out;
 
   // if the generator and make program are not specified then it is an error
-  if (!this->BuildGenerator.size() || !this->BuildMakeProgram.size())
+  if (!this->BuildGenerator.size())
     {
     if(outstring)
       {
       *outstring =
-        "--build-and-test requires that both the generator and makeprogram "
-        "be provided using the --build-generator and --build-makeprogram "
-        "command line options. ";
+        "--build-and-test requires that the generator "
+        "be provided using the --build-generator "
+        "command line option. ";
       }
     return 1;
     }
@@ -238,9 +239,13 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
 
   if(this->BuildNoCMake)
     {
+    // Make the generator available for the Build call below.
     cm.SetGlobalGenerator(cm.CreateGlobalGenerator(
                             this->BuildGenerator.c_str()));
     cm.SetGeneratorToolset(this->BuildGeneratorToolset);
+
+    // Load the cache to make CMAKE_MAKE_PROGRAM available.
+    cm.GetCacheManager()->LoadCache(this->BinaryDir.c_str());
     }
   else
     {

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=91a021146c7a8eb256eca7bb3d9be3acfe3ce814
commit 91a021146c7a8eb256eca7bb3d9be3acfe3ce814
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Nov 14 11:14:22 2013 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Nov 18 11:30:48 2013 -0500

    Simplify some calls to cmGlobalGenerator::Build
    
    Code paths that look up CMAKE_MAKE_PROGRAM from the cache only to
    pass it to Build, which only passes it to GenerateBuildCommand,
    no longer need to do so.  GenerateBuildCommand now knows how to
    look up CMAKE_MAKE_PROGRAM in the cache when no explicit value
    is given, so simply pass 0 now.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 9609497..b11b274 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1562,15 +1562,6 @@ int cmGlobalGenerator::TryCompile(const char *srcdir, const char *bindir,
                                         this->FirstTimeProgress);
     }
 
-  std::string makeCommand = this->CMakeInstance->
-    GetCacheManager()->GetCacheValue("CMAKE_MAKE_PROGRAM");
-  if(makeCommand.size() == 0)
-    {
-    cmSystemTools::Error(
-      "Generator cannot find the appropriate make command.");
-    return 1;
-    }
-
   std::string newTarget;
   if (target && strlen(target))
     {
@@ -1590,7 +1581,7 @@ int cmGlobalGenerator::TryCompile(const char *srcdir, const char *bindir,
   const char* config = mf->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
   return this->Build(srcdir,bindir,projectName,
                      newTarget.c_str(),
-                     output,makeCommand.c_str(),config,false,fast,
+                     output,0,config,false,fast,
                      this->TryCompileTimeout);
 }
 
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 16a6240..bf27c78 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2663,23 +2663,16 @@ int cmake::Build(const std::string& dir,
     this->CreateGlobalGenerator(it.GetValue()));
   std::string output;
   std::string projName;
-  std::string makeProgram;
   if(!it.Find("CMAKE_PROJECT_NAME"))
     {
     std::cerr << "Error: could not find CMAKE_PROJECT_NAME in Cache\n";
     return 1;
     }
   projName = it.GetValue();
-  if(!it.Find("CMAKE_MAKE_PROGRAM"))
-    {
-    std::cerr << "Error: could not find CMAKE_MAKE_PROGRAM in Cache\n";
-    return 1;
-    }
-  makeProgram = it.GetValue();
   return gen->Build(0, dir.c_str(),
                     projName.c_str(), target.c_str(),
                     &output,
-                    makeProgram.c_str(),
+                    0,
                     config.c_str(), clean, false, 0,
                     cmSystemTools::OUTPUT_PASSTHROUGH,
                     nativeOptions);

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=123a0608dfe6cf155f0fc095cf389ae7b3d4ebb0
commit 123a0608dfe6cf155f0fc095cf389ae7b3d4ebb0
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Nov 13 15:12:06 2013 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Nov 18 11:30:48 2013 -0500

    Teach GenerateBuildCommand to find its own make program
    
    Add a cmGlobalGenerator::SelectMakeProgram method to select a
    caller-provided make program, the CMAKE_MAKE_PROGRAM cache entry, or a
    generator-provided default.  Call it from all implementations of the
    GenerateBuildCommand method with the corresponding generator's default,
    if any.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index b653aff..9609497 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -88,6 +88,26 @@ bool cmGlobalGenerator::SetGeneratorToolset(std::string const& ts)
   return false;
 }
 
+std::string cmGlobalGenerator::SelectMakeProgram(const char* makeProgram,
+                                                 std::string makeDefault)
+{
+  if(cmSystemTools::IsOff(makeProgram))
+    {
+    makeProgram =
+      this->CMakeInstance->GetCacheDefinition("CMAKE_MAKE_PROGRAM");
+    if(cmSystemTools::IsOff(makeProgram))
+      {
+      makeProgram = makeDefault.c_str();
+      }
+    if(cmSystemTools::IsOff(makeProgram) &&
+       !(makeProgram && *makeProgram))
+      {
+      makeProgram = "CMAKE_MAKE_PROGRAM-NOTFOUND";
+      }
+    }
+  return makeProgram;
+}
+
 void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang,
                                                 cmMakefile *mf,
                                                 bool optional)
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 37e12ff..74d88f3 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -334,6 +334,8 @@ protected:
   typedef std::vector<std::pair<cmQtAutoGenerators, cmTarget*> > AutogensType;
   void CreateQtAutoGeneratorsTargets(AutogensType& autogens);
 
+  std::string SelectMakeProgram(const char* makeProgram,
+                                std::string makeDefault = "");
 
   // Fill the ProjectMap, this must be called after LocalGenerators
   // has been populated.
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 24bfdc3..77571b2 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -559,7 +559,9 @@ void cmGlobalNinjaGenerator
                        bool /*fast*/,
                        std::vector<std::string> const& makeOptions)
 {
-  makeCommand.push_back(makeProgram);
+  makeCommand.push_back(
+    this->SelectMakeProgram(makeProgram)
+    );
 
   makeCommand.insert(makeCommand.end(),
                      makeOptions.begin(), makeOptions.end());
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 3aa1f5f..e1af2f9 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -566,7 +566,9 @@ void cmGlobalUnixMakefileGenerator3
                        bool fast,
                        std::vector<std::string> const& makeOptions)
 {
-  makeCommand.push_back(makeProgram);
+  makeCommand.push_back(
+    this->SelectMakeProgram(makeProgram)
+    );
 
   // Since we have full control over the invocation of nmake, let us
   // make it quiet.
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index d4d67d0..741d591 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -311,23 +311,56 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
   bool fast,
   std::vector<std::string> const& makeOptions)
 {
-  // now build the test
-  std::string lowerCaseCommand = makeProgram;
-  cmSystemTools::LowerCase(lowerCaseCommand);
-
-  // If makeProgram is devenv, parent class knows how to generate command:
-  if (lowerCaseCommand.find("devenv") != std::string::npos ||
-      lowerCaseCommand.find("VCExpress") != std::string::npos)
+  // Select the caller- or user-preferred make program, else MSBuild.
+  std::string makeProgramSelected =
+    this->SelectMakeProgram(makeProgram, this->GetMSBuildCommand());
+
+  // Check if the caller explicitly requested a devenv tool.
+  std::string makeProgramLower = makeProgramSelected;
+  cmSystemTools::LowerCase(makeProgramLower);
+  bool useDevEnv =
+    (makeProgramLower.find("devenv") != std::string::npos ||
+     makeProgramLower.find("vcexpress") != std::string::npos);
+
+  // MSBuild is preferred (and required for VS Express), but if the .sln has
+  // an Intel Fortran .vfproj then we have to use devenv. Parse it to find out.
+  cmSlnData slnData;
+  {
+  std::string slnFile;
+  if(projectDir && *projectDir)
+    {
+    slnFile = projectDir;
+    slnFile += "/";
+    }
+  slnFile += projectName;
+  slnFile += ".sln";
+  cmVisualStudioSlnParser parser;
+  if(parser.ParseFile(slnFile, slnData,
+                      cmVisualStudioSlnParser::DataGroupProjects))
+    {
+    std::vector<cmSlnProjectEntry> slnProjects = slnData.GetProjects();
+    for(std::vector<cmSlnProjectEntry>::iterator i = slnProjects.begin();
+        !useDevEnv && i != slnProjects.end(); ++i)
+      {
+      std::string proj = i->GetRelativePath();
+      if(proj.size() > 7 &&
+         proj.substr(proj.size()-7) == ".vfproj")
+        {
+        useDevEnv = true;
+        }
+      }
+    }
+  }
+  if(useDevEnv)
     {
+    // Use devenv to build solutions containing Intel Fortran projects.
     cmGlobalVisualStudio7Generator::GenerateBuildCommand(
       makeCommand, makeProgram, projectName, projectDir,
       targetName, config, fast, makeOptions);
     return;
     }
 
-  // Otherwise, assume MSBuild command line, and construct accordingly.
-
-  makeCommand.push_back(makeProgram);
+  makeCommand.push_back(makeProgramSelected);
 
   // msbuild.exe CxxOnly.sln /t:Build /p:Configuration=Debug /target:ALL_BUILD
   if(!targetName || strlen(targetName) == 0)
@@ -346,28 +379,11 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
     if (targetProject.find('/') == std::string::npos)
       {
       // it might be in a subdir
-      cmVisualStudioSlnParser parser;
-      cmSlnData slnData;
-      std::string slnFile;
-      if (projectDir && *projectDir)
-        {
-        slnFile = projectDir;
-        slnFile += '/';
-        slnFile += projectName;
-        }
-      else
-        {
-        slnFile = projectName;
-        }
-      if (parser.ParseFile(slnFile + ".sln", slnData,
-                           cmVisualStudioSlnParser::DataGroupProjects))
+      if (cmSlnProjectEntry const* proj =
+          slnData.GetProjectByName(targetName))
         {
-        if (cmSlnProjectEntry const* proj =
-            slnData.GetProjectByName(targetName))
-          {
-          targetProject = proj->GetRelativePath();
-          cmSystemTools::ConvertToUnixSlashes(targetProject);
-          }
+        targetProject = proj->GetRelativePath();
+        cmSystemTools::ConvertToUnixSlashes(targetProject);
         }
       }
     makeCommand.push_back(targetProject);
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index 51f38c2..08ea249 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -118,24 +118,9 @@ cmGlobalVisualStudio6Generator::GenerateBuildCommand(
   )
 {
   // now build the test
-  std::vector<std::string> mp;
-  mp.push_back("[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio"
-               "\\6.0\\Setup;VsCommonDir]/MSDev98/Bin");
-  cmSystemTools::ExpandRegistryValues(mp[0]);
-  std::string originalCommand = makeProgram;
-  std::string makeCommandFound =
-    cmSystemTools::FindProgram(makeProgram, mp);
-  if(makeCommandFound.size() == 0)
-    {
-    std::string e = "Generator cannot find Visual Studio 6 msdev program \"";
-    e += originalCommand;
-    e += "\" specified by CMAKE_MAKE_PROGRAM cache entry.  ";
-    e += "Please fix the setting.";
-    cmSystemTools::Error(e.c_str());
-    return;
-    }
-
-  makeCommand.push_back(makeCommandFound);
+  makeCommand.push_back(
+    this->SelectMakeProgram(makeProgram, this->GetMSDevCommand())
+    );
 
   makeCommand.push_back(std::string(projectName)+".dsw");
   makeCommand.push_back("/MAKE");
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 2602f83..08eff31 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -148,7 +148,21 @@ void cmGlobalVisualStudio7Generator::GenerateBuildCommand(
   bool /*fast*/,
   std::vector<std::string> const& makeOptions)
 {
-  makeCommand.push_back(makeProgram);
+  // Select the caller- or user-preferred make program, else devenv.
+  std::string makeProgramSelected =
+    this->SelectMakeProgram(makeProgram, this->GetDevEnvCommand());
+
+  // Ignore the above preference if it is msbuild.
+  // Assume any other value is either a devenv or
+  // command-line compatible with devenv.
+  std::string makeProgramLower = makeProgramSelected;
+  cmSystemTools::LowerCase(makeProgramLower);
+  if(makeProgramLower.find("msbuild") != std::string::npos)
+    {
+    makeProgramSelected = this->GetDevEnvCommand();
+    }
+
+  makeCommand.push_back(makeProgramSelected);
 
   makeCommand.push_back(std::string(projectName) + ".sln");
   bool clean = false;
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index f8ec8a0..be0459d 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -269,13 +269,9 @@ cmGlobalXCodeGenerator::GenerateBuildCommand(
   std::vector<std::string> const& makeOptions)
 {
   // now build the test
-  if(makeProgram == 0 || !strlen(makeProgram))
-    {
-    cmSystemTools::Error(
-      "Generator cannot find the appropriate make command.");
-    return;
-    }
-  makeCommand.push_back(makeProgram);
+  makeCommand.push_back(
+    this->SelectMakeProgram(makeProgram, "xcodebuild")
+    );
 
   makeCommand.push_back("-project");
   std::string projectArg = projectName;

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list