Merge topic 'FindGit-local-Github'

ff880ece Help: Add notes for topic 'FindGit-local-Github'
54690624 FindGit: Search in 'GitHub for Windows' user directory
This commit is contained in:
Brad King 2015-01-15 09:54:14 -05:00 committed by CMake Topic Stage
commit 80a6c38d98
2 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,5 @@
FindGit-local-Github
--------------------
* The :module:`FindGit` module learned to find the ``git`` command-line tool
that comes with GitHub for Windows installed in user home directories.

View File

@ -45,11 +45,15 @@ set(git_names git eg)
if(WIN32) if(WIN32)
if(NOT CMAKE_GENERATOR MATCHES "MSYS") if(NOT CMAKE_GENERATOR MATCHES "MSYS")
set(git_names git.cmd git eg.cmd eg) set(git_names git.cmd git eg.cmd eg)
# GitHub search path for Windows
set(github_path "$ENV{LOCALAPPDATA}/Github/PortableGit*/bin")
file(GLOB github_path "${github_path}")
endif() endif()
endif() endif()
find_program(GIT_EXECUTABLE find_program(GIT_EXECUTABLE
NAMES ${git_names} NAMES ${git_names}
PATHS ${github_path}
PATH_SUFFIXES Git/cmd Git/bin PATH_SUFFIXES Git/cmd Git/bin
DOC "git command line client" DOC "git command line client"
) )