[Cmake-commits] CMake branch, next, updated. v2.8.7-2202-g85200d8

Rolf Eike Beer eike at sf-mail.de
Mon Jan 23 14:11:25 EST 2012


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  85200d8e6e841d94e53674025cadb6a1ed857c53 (commit)
       via  a803a622d052e6b50873f6bf6a3ab224f656333f (commit)
      from  6d403e168707cbdbf81bcb503de07a0a56770ea3 (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=85200d8e6e841d94e53674025cadb6a1ed857c53
commit 85200d8e6e841d94e53674025cadb6a1ed857c53
Merge: 6d403e1 a803a62
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Mon Jan 23 14:11:16 2012 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jan 23 14:11:16 2012 -0500

    Merge topic 'improve-findgit' into next
    
    a803a62 FindGit: support version number


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a803a622d052e6b50873f6bf6a3ab224f656333f
commit a803a622d052e6b50873f6bf6a3ab224f656333f
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Mon Jan 23 19:46:08 2012 +0100
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Mon Jan 23 20:10:42 2012 +0100

    FindGit: support version number

diff --git a/Modules/FindGit.cmake b/Modules/FindGit.cmake
index 503b640..f89d1af 100644
--- a/Modules/FindGit.cmake
+++ b/Modules/FindGit.cmake
@@ -1,6 +1,7 @@
 # The module defines the following variables:
 #   GIT_EXECUTABLE - path to git command line client
 #   GIT_FOUND - true if the command line client was found
+#   GIT_VERSION_STRING - the version of git found (since CMake 2.8.8)
 # Example usage:
 #   find_package(Git)
 #   if(GIT_FOUND)
@@ -9,6 +10,7 @@
 
 #=============================================================================
 # Copyright 2010 Kitware, Inc.
+# Copyright 2012 Rolf Eike Beer <eike at sf-mail.de>
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.
@@ -40,8 +42,21 @@ find_program(GIT_EXECUTABLE
   )
 mark_as_advanced(GIT_EXECUTABLE)
 
+if(GIT_EXECUTABLE)
+  execute_process(COMMAND ${GIT_EXECUTABLE} --version
+                  OUTPUT_VARIABLE git_version
+                  ERROR_QUIET
+                  OUTPUT_STRIP_TRAILING_WHITESPACE)
+  if (git_version MATCHES "^git version [0-9]")
+    string(REPLACE "git version " "" GIT_VERSION_STRING "${git_version}")
+  endif()
+  unset(git_version)
+endif(GIT_EXECUTABLE)
+
 # Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if
 # all listed variables are TRUE
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-find_package_handle_standard_args(Git DEFAULT_MSG GIT_EXECUTABLE)
+find_package_handle_standard_args(Git
+                                  REQUIRED_VARS GIT_EXECUTABLE
+                                  VERSION_VAR GIT_VERSION_STRING)

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

Summary of changes:
 Modules/FindGit.cmake |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list