Dear CMake devs,
please find attached a patch to slightly improve FindGit.cmake.

I did test it, but did not understand why GIT_FOUND was set in the first
place.

Bye
Christoph
>From c29c384565b7d976e36156f9351af8400cd60dc4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= <[email protected]>
Date: Tue, 26 Jan 2016 21:53:16 +0100
Subject: [PATCH] FindGit: Document Git_FOUND, unset internal var

* Git is called Git, not git.
* FindGit sets Git_FOUND, too.
* Unset internal variable git_names
---
 Modules/FindGit.cmake | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/Modules/FindGit.cmake b/Modules/FindGit.cmake
index 2c3e5fd..2b3a5d6 100644
--- a/Modules/FindGit.cmake
+++ b/Modules/FindGit.cmake
@@ -8,21 +8,21 @@
 #
 # ::
 #
-#    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)
+#    GIT_EXECUTABLE - path to Git command line client
+#    Git_FOUND / GIT_FOUND - true if the Git command line client was found
+#    GIT_VERSION_STRING - the version of Git found
 #
 # Example usage:
 #
 # ::
 #
 #    find_package(Git)
-#    if(GIT_FOUND)
-#      message("git found: ${GIT_EXECUTABLE}")
+#    if(Git_FOUND)
+#      message("Git found: ${GIT_EXECUTABLE}")
 #    endif()
 
 #=============================================================================
-# Copyright 2010 Kitware, Inc.
+# Copyright 2016 Kitware, Inc.
 # Copyright 2012 Rolf Eike Beer <[email protected]>
 #
 # Distributed under the OSI-approved BSD License (the "License");
@@ -57,10 +57,11 @@ find_program(GIT_EXECUTABLE
   NAMES ${git_names}
   PATHS ${github_path} ${_git_sourcetree_path}
   PATH_SUFFIXES Git/cmd Git/bin
-  DOC "git command line client"
+  DOC "Git command line client"
   )
 mark_as_advanced(GIT_EXECUTABLE)
 
+unset(git_names)
 unset(_git_sourcetree_path)
 
 if(GIT_EXECUTABLE)
@@ -74,7 +75,7 @@ if(GIT_EXECUTABLE)
   unset(git_version)
 endif()
 
-# Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if
+# 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)
-- 
2.6.2

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to