diff options
author | Brad King <brad.king@kitware.com> | 2017-03-10 21:13:05 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-03-10 21:13:05 (GMT) |
commit | 4aca67b0fb03c77b7621399ff6a7a2eae37af4f8 (patch) | |
tree | 5e8fc7ec7f13932022a0506a8f234c9623b9c3a4 | |
parent | 905f139b8822375e752b8c349d71b2c48c32f0a7 (diff) | |
parent | c4d481e5b8558ac00e637b36312685762a82bb23 (diff) | |
download | CMake-4aca67b0fb03c77b7621399ff6a7a2eae37af4f8.zip CMake-4aca67b0fb03c77b7621399ff6a7a2eae37af4f8.tar.gz CMake-4aca67b0fb03c77b7621399ff6a7a2eae37af4f8.tar.bz2 |
Merge branch 'FindGit-avoid-vs-2017-git' into release
-rw-r--r-- | Modules/FindGit.cmake | 16 |
1 files changed, 15 insertions, 1 deletions
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) |