[Cmake-commits] CMake branch, next, updated. v2.8.1-1301-gdf29e0f

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Jun 3 17:39:07 EDT 2010


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  df29e0f528254bfbba7c1c5a2e8dd779afaa5a92 (commit)
       via  29383b4b85fc0f728a166a9d4e8abf123f862212 (commit)
      from  5f54dd80ba3a77c3762ae976ed3b49b2ab7319ff (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=df29e0f528254bfbba7c1c5a2e8dd779afaa5a92
commit df29e0f528254bfbba7c1c5a2e8dd779afaa5a92
Merge: 5f54dd8 29383b4
Author: David Cole <david.cole at kitware.com>
Date:   Thu Jun 3 17:37:46 2010 -0400

    Merge branch 'add-git-to-ExternalProject' into next

diff --cc Modules/ExternalProject.cmake
index 7f3a6ef,15db793..15749f2
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@@ -806,13 -746,11 +806,12 @@@ function(_ep_add_download_command name
      get_filename_component(src_name "${source_dir}" NAME)
      get_filename_component(work_dir "${source_dir}" PATH)
      set(comment "Performing download step (SVN checkout) for '${name}'")
 -    set(cmd ${Subversion_SVN_EXECUTABLE} co ${svn_repository} ${svn_revision} ${src_name})
 +    set(cmd ${Subversion_SVN_EXECUTABLE} co ${svn_repository} ${svn_revision}
 +      --username=${svn_username} --password=${svn_password} ${src_name})
      list(APPEND depends ${stamp_dir}/${name}-svninfo.txt)
    elseif(git_repository)
-     find_program(git_EXECUTABLE NAMES git.cmd git eg.cmd eg DOC "git command line client")
-     mark_as_advanced(git_EXECUTABLE)
-     if(NOT git_EXECUTABLE)
+     find_package(Git)
+     if(NOT GIT_EXECUTABLE)
        message(FATAL_ERROR "error: could not find git for clone of ${name}")
      endif()
  
@@@ -935,13 -870,10 +934,13 @@@ function(_ep_add_update_command name
      set(work_dir ${source_dir})
      set(comment "Performing update step (SVN update) for '${name}'")
      get_property(svn_revision TARGET ${name} PROPERTY _EP_SVN_REVISION)
 -    set(cmd ${Subversion_SVN_EXECUTABLE} up ${svn_revision})
 +    get_property(svn_username TARGET ${name} PROPERTY _EP_SVN_USERNAME)
 +    get_property(svn_password TARGET ${name} PROPERTY _EP_SVN_PASSWORD)
 +    set(cmd ${Subversion_SVN_EXECUTABLE} up ${svn_revision}
 +      --username=${svn_username} --password=${svn_password})
      set(always 1)
    elseif(git_repository)
-     if(NOT git_EXECUTABLE)
+     if(NOT GIT_EXECUTABLE)
        message(FATAL_ERROR "error: could not find git for fetch of ${name}")
      endif()
      set(work_dir ${source_dir})

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=29383b4b85fc0f728a166a9d4e8abf123f862212
commit 29383b4b85fc0f728a166a9d4e8abf123f862212
Author: David Cole <david.cole at kitware.com>
Date:   Thu Jun 3 17:30:07 2010 -0400

    Add FindGit module.
    
    Use it from ExternalProject and the ExternalProject test's
    CMakeLists file rather than having duplicate find_program calls.
    Add logic so that we do not try to use *.cmd variants of git
    programs when using the MSYS Makefiles generator. Should fix
    the last remaining dashboard issue with the new ExternalProject
    git support additions.
    
    Also, correct minor problem regarding placement of the local git
    repo during test execution. On clean builds, it was being placed
    incorrectly because of the ../.. relative reference. Use an absolute
    path to place the local git repo in the proper directory, and only
    use the relative reference when referring to it.

diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index b1140c8..15db793 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -749,15 +749,14 @@ function(_ep_add_download_command name)
     set(cmd ${Subversion_SVN_EXECUTABLE} co ${svn_repository} ${svn_revision} ${src_name})
     list(APPEND depends ${stamp_dir}/${name}-svninfo.txt)
   elseif(git_repository)
-    find_program(git_EXECUTABLE NAMES git.cmd git eg.cmd eg DOC "git command line client")
-    mark_as_advanced(git_EXECUTABLE)
-    if(NOT git_EXECUTABLE)
+    find_package(Git)
+    if(NOT GIT_EXECUTABLE)
       message(FATAL_ERROR "error: could not find git for clone of ${name}")
     endif()
 
     # The git submodule update '--recursive' flag requires git >= v1.6.5
     #
-    _ep_get_git_version("${git_EXECUTABLE}" git_version)
+    _ep_get_git_version("${GIT_EXECUTABLE}" git_version)
     if(git_version VERSION_LESS 1.6.5)
       message(FATAL_ERROR "error: git version 1.6.5 or later required for 'git submodule update --recursive': git_version='${git_version}'")
     endif()
@@ -784,7 +783,7 @@ function(_ep_add_download_command name)
     # The script will delete the source directory and then call git clone.
     #
     _ep_write_gitclone_script(${tmp_dir}/${name}-gitclone.cmake ${source_dir}
-      ${git_EXECUTABLE} ${git_repository} ${git_tag} ${src_name} ${work_dir}
+      ${GIT_EXECUTABLE} ${git_repository} ${git_tag} ${src_name} ${work_dir}
       )
     set(comment "Performing download step (git clone) for '${name}'")
     set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-gitclone.cmake)
@@ -874,7 +873,7 @@ function(_ep_add_update_command name)
     set(cmd ${Subversion_SVN_EXECUTABLE} up ${svn_revision})
     set(always 1)
   elseif(git_repository)
-    if(NOT git_EXECUTABLE)
+    if(NOT GIT_EXECUTABLE)
       message(FATAL_ERROR "error: could not find git for fetch of ${name}")
     endif()
     set(work_dir ${source_dir})
@@ -883,9 +882,9 @@ function(_ep_add_update_command name)
     if(NOT git_tag)
       set(git_tag "master")
     endif()
-    set(cmd ${git_EXECUTABLE} fetch
-      COMMAND ${git_EXECUTABLE} checkout ${git_tag}
-      COMMAND ${git_EXECUTABLE} submodule update --recursive
+    set(cmd ${GIT_EXECUTABLE} fetch
+      COMMAND ${GIT_EXECUTABLE} checkout ${git_tag}
+      COMMAND ${GIT_EXECUTABLE} submodule update --recursive
       )
     set(always 1)
   endif()
diff --git a/Modules/FindGit.cmake b/Modules/FindGit.cmake
new file mode 100644
index 0000000..2d82142
--- /dev/null
+++ b/Modules/FindGit.cmake
@@ -0,0 +1,46 @@
+# The module defines the following variables:
+#   GIT_EXECUTABLE - path to git command line client
+#   GIT_FOUND - true if the command line client was found
+# Example usage:
+#   find_package(Git)
+#   if(GIT_FOUND)
+#     message("git found: ${GIT_EXECUTABLE}")
+#   endif()
+
+#=============================================================================
+# Copyright 2010 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 distributed this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+# Look for 'git' or 'eg' (easy git)
+#
+set(git_names git eg)
+
+# Prefer .cmd variants on Windows unless running in a Makefile
+# in the MSYS shell.
+#
+if(WIN32)
+  if(NOT CMAKE_GENERATOR MATCHES "MSYS")
+    set(git_names git.cmd git eg.cmd eg)
+  endif()
+endif()
+
+find_program(GIT_EXECUTABLE
+  NAMES ${git_names}
+  DOC "git command line client"
+  )
+mark_as_advanced(GIT_EXECUTABLE)
+
+# Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if
+# all listed variables are TRUE
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Git DEFAULT_MSG GIT_EXECUTABLE)
diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt
index 8257e90..2e387cb 100644
--- a/Tests/ExternalProject/CMakeLists.txt
+++ b/Tests/ExternalProject/CMakeLists.txt
@@ -5,7 +5,7 @@ include(ExternalProject)
 
 find_package(CVS)
 find_package(Subversion)
-find_program(git_EXECUTABLE NAMES git.cmd git eg.cmd eg DOC "git command line client")
+find_package(Git)
 
 set(base "${CMAKE_BINARY_DIR}/CMakeExternals")
 set(binary_base "${base}/Build")
@@ -302,11 +302,11 @@ endif()
 
 set(do_git_tests 0)
 
-if(git_EXECUTABLE)
+if(GIT_EXECUTABLE)
   set(do_git_tests 1)
 
   execute_process(
-    COMMAND "${git_EXECUTABLE}" --version
+    COMMAND "${GIT_EXECUTABLE}" --version
     OUTPUT_VARIABLE ov
     OUTPUT_STRIP_TRAILING_WHITESPACE
     )
@@ -328,10 +328,10 @@ if(do_git_tests)
   #
   set(proj SetupLocalGITRepository)
   ExternalProject_Add(${proj}
-    SOURCE_DIR ${local_git_repo}
+    SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/LocalRepositories/GIT
     URL ${CMAKE_CURRENT_SOURCE_DIR}/gitrepo.tgz
     BUILD_COMMAND ""
-    CONFIGURE_COMMAND "${git_EXECUTABLE}" --version
+    CONFIGURE_COMMAND "${GIT_EXECUTABLE}" --version
     INSTALL_COMMAND ""
   )
 
@@ -444,4 +444,4 @@ message(STATUS "can_build_tutorial_step5='${can_build_tutorial_step5}'")
 message(STATUS "do_cvs_tests='${do_cvs_tests}'")
 message(STATUS "do_svn_tests='${do_svn_tests}'")
 message(STATUS "do_git_tests='${do_git_tests}'")
-message(STATUS "git_EXECUTABLE='${git_EXECUTABLE}'")
+message(STATUS "GIT_EXECUTABLE='${GIT_EXECUTABLE}'")

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

Summary of changes:
 Modules/ExternalProject.cmake        |   17 ++++++------
 Modules/FindGit.cmake                |   46 ++++++++++++++++++++++++++++++++++
 Tests/ExternalProject/CMakeLists.txt |   12 ++++----
 3 files changed, 60 insertions(+), 15 deletions(-)
 create mode 100644 Modules/FindGit.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list