[Cmake-commits] CMake branch, next, updated. v3.1.1-2425-g5348b1f

Brad King brad.king at kitware.com
Wed Jan 28 14:16:02 EST 2015


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  5348b1f86b070d6c4f4402aa09d2bc9c606908ba (commit)
       via  6eca2590558ae1ad4de989718a496a2f68ab68d4 (commit)
       via  11e2e6cadf7f0ee36b7ccecaa11457949382b75f (commit)
       via  e4055a6144c63c83fe2f39440ecfb9a0bcbfae0d (commit)
      from  5257503e78c4d779e41f93643677ae89b1d16022 (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=5348b1f86b070d6c4f4402aa09d2bc9c606908ba
commit 5348b1f86b070d6c4f4402aa09d2bc9c606908ba
Merge: 5257503 6eca259
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 28 14:16:01 2015 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jan 28 14:16:01 2015 -0500

    Merge topic 'xcode-revise-make-program' into next
    
    6eca2590 Xcode: Switch to internal CMAKE_MAKE_PROGRAM lookup by generator (#15324)
    11e2e6ca Xcode: Select make program at build time
    e4055a61 Xcode: Add internal API to find xcodebuild


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6eca2590558ae1ad4de989718a496a2f68ab68d4
commit 6eca2590558ae1ad4de989718a496a2f68ab68d4
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 28 14:00:02 2015 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jan 28 14:02:07 2015 -0500

    Xcode: Switch to internal CMAKE_MAKE_PROGRAM lookup by generator (#15324)
    
    The "cmakexbuild" wrapper is not needed for Xcode 4 and above, and the
    path to it may change when CMake moves.  Avoid storing a specific path
    to a build program in CMakeCache.txt and instead compute the value for
    CMAKE_MAKE_PROGRAM on demand.  However, if a user does set the value
    explicitly then honor it.
    
    This does for Xcode what commit v3.0.0-rc1~260^2~4 (VS: Switch to
    internal CMAKE_MAKE_PROGRAM lookup by generators, 2013-11-15) did for
    Visual Studio generators.

diff --git a/Help/release/dev/xcode-revise-make-program.rst b/Help/release/dev/xcode-revise-make-program.rst
new file mode 100644
index 0000000..f50cf44
--- /dev/null
+++ b/Help/release/dev/xcode-revise-make-program.rst
@@ -0,0 +1,6 @@
+xcode-revise-make-program
+-------------------------
+
+* The :generator:`Xcode` generator no longer requires a value for
+  the :variable:`CMAKE_MAKE_PROGRAM` variable to be located up front.
+  It now locates ``xcodebuild`` when needed at build time.
diff --git a/Help/variable/CMAKE_MAKE_PROGRAM.rst b/Help/variable/CMAKE_MAKE_PROGRAM.rst
index 97caa8a..f1d88a5 100644
--- a/Help/variable/CMAKE_MAKE_PROGRAM.rst
+++ b/Help/variable/CMAKE_MAKE_PROGRAM.rst
@@ -23,8 +23,15 @@ to configure the project:
   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.
+  This generator prefers 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 ``xcodebuild`` is easy to find,
+  the ``cmakexbuild`` wrapper is needed only for older Xcode versions,
+  and the path to ``cmakexbuild`` may be outdated if CMake itself moves.
+
+  For compatibility with versions of CMake prior to 3.2, if
+  a user or project explicitly adds ``CMAKE_MAKE_PROGRAM`` to
+  the CMake cache then CMake will use the specified value.
 
 * The Visual Studio generators set this to the full path to
   ``MSBuild.exe`` (VS >= 10), ``devenv.com`` (VS 7,8,9),
diff --git a/Modules/CMakeFindXCode.cmake b/Modules/CMakeFindXCode.cmake
deleted file mode 100644
index 5c4f596..0000000
--- a/Modules/CMakeFindXCode.cmake
+++ /dev/null
@@ -1,20 +0,0 @@
-
-#=============================================================================
-# Copyright 2005-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 xcodebuild
-  PATHS
-  /usr/bin
-  )
-mark_as_advanced(CMAKE_MAKE_PROGRAM)
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 4c95a9f..6d0fedc 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -315,25 +315,6 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
                            "make program",
                            cmCacheManager::FILEPATH);
     }
-
-  if(makeProgram.find("xcodebuild") != makeProgram.npos)
-    {
-    // due to the text file busy /bin/sh problem with xcodebuild
-    // use the cmakexbuild wrapper instead.  This program
-    // will run xcodebuild and if it sees the error text file busy
-    // it will stop forwarding output, and let the build finish.
-    // Then it will retry the build.  It will continue this
-    // until no text file busy errors occur.
-    std::string cmakexbuild =
-      this->CMakeInstance->GetCacheManager()->GetCacheValue("CMAKE_COMMAND");
-    cmakexbuild = cmakexbuild.substr(0, cmakexbuild.length()-5);
-    cmakexbuild += "cmakexbuild";
-
-    mf->AddCacheDefinition("CMAKE_MAKE_PROGRAM",
-                           cmakexbuild.c_str(),
-                           "make program",
-                           cmCacheManager::FILEPATH);
-    }
 }
 
 // enable the given language
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index ebad7da..cd0dcc6 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -136,7 +136,6 @@ cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(std::string const& version)
   sscanf(this->VersionString.c_str(), "%u.%u", &v[0], &v[1]);
   this->XcodeVersion = 10*v[0] + v[1];
 
-  this->FindMakeProgramFile = "CMakeFindXCode.cmake";
   this->RootObject = 0;
   this->MainGroupChildren = 0;
   this->SourcesGroupChildren = 0;
@@ -203,6 +202,19 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::Factory
 }
 
 //----------------------------------------------------------------------------
+void cmGlobalXCodeGenerator::FindMakeProgram(cmMakefile* mf)
+{
+  // The Xcode generator knows how to lookup its 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->GetXcodeBuildCommand().c_str());
+    }
+}
+
+//----------------------------------------------------------------------------
 std::string const& cmGlobalXCodeGenerator::GetXcodeBuildCommand()
 {
   if(!this->XcodeBuildCommandInitialized)
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index e54bb37..f513e28 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -70,6 +70,8 @@ public:
                                         const std::string& suffix,
                                         std::string& dir);
 
+  virtual void FindMakeProgram(cmMakefile*);
+
   ///! What is the configurations directory variable called?
   virtual const char* GetCMakeCFGIntDir() const;
   ///! expand CFGIntDir
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 3aecd9b..035f161 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -51,7 +51,7 @@ if(BUILD_TESTING)
     set(CMake_TEST_DEVENV "${CMAKE_MAKE_PROGRAM}")
   endif()
 
-  if(CMAKE_GENERATOR MATCHES "Visual Studio")
+  if(CMAKE_GENERATOR MATCHES "Visual Studio|Xcode")
     set(CMake_TEST_EXPLICIT_MAKE_PROGRAM "")
   else()
     set(CMake_TEST_EXPLICIT_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM}")

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=11e2e6cadf7f0ee36b7ccecaa11457949382b75f
commit 11e2e6cadf7f0ee36b7ccecaa11457949382b75f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 28 13:59:32 2015 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jan 28 14:01:55 2015 -0500

    Xcode: Select make program at build time
    
    Extend the change made in commit v3.0.0-rc1~260^2~16 (Teach
    GenerateBuildCommand to find its own make program, 2013-11-13) to have
    the Xcode generator pick between "xcodebuild" and CMake's own copy of
    "cmakexbuild" at build time based on the version of Xcode.

diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 3b4dd17..ebad7da 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -303,7 +303,7 @@ cmGlobalXCodeGenerator::GenerateBuildCommand(
 {
   // now build the test
   makeCommand.push_back(
-    this->SelectMakeProgram(makeProgram, "xcodebuild")
+    this->SelectMakeProgram(makeProgram, this->GetXcodeBuildCommand())
     );
 
   makeCommand.push_back("-project");

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e4055a6144c63c83fe2f39440ecfb9a0bcbfae0d
commit e4055a6144c63c83fe2f39440ecfb9a0bcbfae0d
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 28 13:31:18 2015 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jan 28 13:41:55 2015 -0500

    Xcode: Add internal API to find xcodebuild
    
    Teach the Xcode generator to compute the location of this tool or the
    cmakexbuild wrapper.  Add internal APIs to get the locations on demand.
    
    Use the "cmakexbuild" wrapper for Xcode < 4, and "xcodebuild" for modern
    Xcode.

diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index b6c428b..3b4dd17 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -143,6 +143,7 @@ cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(std::string const& version)
   this->ResourcesGroupChildren = 0;
   this->CurrentMakefile = 0;
   this->CurrentLocalGenerator = 0;
+  this->XcodeBuildCommandInitialized = false;
 }
 
 //----------------------------------------------------------------------------
@@ -202,6 +203,36 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::Factory
 }
 
 //----------------------------------------------------------------------------
+std::string const& cmGlobalXCodeGenerator::GetXcodeBuildCommand()
+{
+  if(!this->XcodeBuildCommandInitialized)
+    {
+    this->XcodeBuildCommandInitialized = true;
+    this->XcodeBuildCommand = this->FindXcodeBuildCommand();
+    }
+  return this->XcodeBuildCommand;
+}
+
+//----------------------------------------------------------------------------
+std::string cmGlobalXCodeGenerator::FindXcodeBuildCommand()
+{
+  if (this->XcodeVersion >= 40)
+    {
+    std::string makeProgram = cmSystemTools::FindProgram("xcodebuild");
+    if (makeProgram.empty())
+      {
+      makeProgram = "xcodebuild";
+      }
+    return makeProgram;
+    }
+  else
+    {
+    // Use cmakexbuild wrapper to suppress environment dump from output.
+    return cmSystemTools::GetCMakeCommand() + "xbuild";
+    }
+}
+
+//----------------------------------------------------------------------------
 bool cmGlobalXCodeGenerator::SetGeneratorToolset(std::string const& ts,
                                                  cmMakefile* mf)
 {
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index a39c8c7..e54bb37 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -212,6 +212,11 @@ protected:
   std::vector<cmXCodeObject*> XCodeObjects;
   cmXCodeObject* RootObject;
 private:
+  std::string const& GetXcodeBuildCommand();
+  std::string FindXcodeBuildCommand();
+  std::string XcodeBuildCommand;
+  bool XcodeBuildCommandInitialized;
+
   void PrintCompilerAdvice(std::ostream&, std::string const&,
                            const char*) const {}
 

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

Summary of changes:
 Help/release/dev/xcode-revise-make-program.rst |    6 +++
 Help/variable/CMAKE_MAKE_PROGRAM.rst           |   11 +++++-
 Modules/CMakeFindXCode.cmake                   |   20 ----------
 Source/cmGlobalGenerator.cxx                   |   19 ----------
 Source/cmGlobalXCodeGenerator.cxx              |   47 +++++++++++++++++++++++-
 Source/cmGlobalXCodeGenerator.h                |    7 ++++
 Tests/CMakeLists.txt                           |    2 +-
 7 files changed, 68 insertions(+), 44 deletions(-)
 create mode 100644 Help/release/dev/xcode-revise-make-program.rst
 delete mode 100644 Modules/CMakeFindXCode.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list