[Cmake-commits] CMake branch, next, updated. v3.8.0-rc2-459-g774841f

Kitware Robot kwrobot at kitware.com
Fri Mar 10 16:15:04 EST 2017


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  774841f7ddc9309f74d8becc32fac43beaf1fc3c (commit)
       via  c4d481e5b8558ac00e637b36312685762a82bb23 (commit)
      from  227852fc9b275aefa80689a92f77ea2e89a65274 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=774841f7ddc9309f74d8becc32fac43beaf1fc3c
commit 774841f7ddc9309f74d8becc32fac43beaf1fc3c
Merge: 227852f c4d481e
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Mar 10 21:12:45 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Mar 10 16:12:49 2017 -0500

    Stage topic 'FindGit-avoid-vs-2017-git'
    
    Topic-id: 23001
    Topic-url: https://gitlab.kitware.com/cmake/cmake/merge_requests/575


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c4d481e5b8558ac00e637b36312685762a82bb23
commit c4d481e5b8558ac00e637b36312685762a82bb23
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Mar 10 16:00:34 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Mar 10 16:09:31 2017 -0500

    FindGit: Avoid finding VS 2017 non-general Git installation
    
    At a VS 2017 command prompt the `PATH` contains a directory that happens
    to have a `Git/cmd/git.exe` inside it.  However, this executable is not
    meant for general use.  Revise our use of `Git/` path suffixes to be
    more specific to its original purpose of searching in the typical
    `c:/Program Files*/Git/` installation directories.  Avoid using the
    suffixes on `PATH` entries.
    
    Fixes: #16706

diff --git a/Modules/FindGit.cmake b/Modules/FindGit.cmake
index b830c08..fae31eb 100644
--- a/Modules/FindGit.cmake
+++ b/Modules/FindGit.cmake
@@ -43,12 +43,26 @@ if(CMAKE_HOST_WIN32)
   endif()
 endif()
 
+# First search the PATH and specific locations.
 find_program(GIT_EXECUTABLE
   NAMES ${git_names}
   PATHS ${github_path} ${_git_sourcetree_path}
-  PATH_SUFFIXES Git/cmd Git/bin
   DOC "Git command line client"
   )
+
+if(CMAKE_HOST_WIN32)
+  # Now look for installations in Git/ directories under typical installation
+  # prefixes on Windows.  Exclude PATH from this search because VS 2017's
+  # command prompt happens to have a PATH entry with a Git/ subdirectory
+  # containing a minimal git not meant for general use.
+  find_program(GIT_EXECUTABLE
+    NAMES ${git_names}
+    PATH_SUFFIXES Git/cmd Git/bin
+    NO_SYSTEM_ENVIRONMENT_PATH
+    DOC "Git command line client"
+    )
+endif()
+
 mark_as_advanced(GIT_EXECUTABLE)
 
 unset(git_names)

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

Summary of changes:
 Modules/FindGit.cmake |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list