summaryrefslogtreecommitdiffstats
path: root/Source/CMakeVersion.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-07-25 12:24:48 (GMT)
committerBrad King <brad.king@kitware.com>2019-07-29 15:25:44 (GMT)
commit74ff80323c23a41b4b311b0cf67d6f5f59034d08 (patch)
tree61a2247d8a15bf71c96885aa018d8a1272068f6c /Source/CMakeVersion.cmake
parente1e7986c00912a89b644ff60a8e63189f8ba1ac5 (diff)
downloadCMake-74ff80323c23a41b4b311b0cf67d6f5f59034d08.zip
CMake-74ff80323c23a41b4b311b0cf67d6f5f59034d08.tar.gz
CMake-74ff80323c23a41b4b311b0cf67d6f5f59034d08.tar.bz2
CMakeVersion: Use FindGit module to find Git
We now require at least CMake 3.1 to build, and that has the FindGit module.
Diffstat (limited to 'Source/CMakeVersion.cmake')
-rw-r--r--Source/CMakeVersion.cmake5
1 files changed, 2 insertions, 3 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 02cf748..4616dee 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -15,9 +15,8 @@ else()
# Try to identify the current development source version.
set(CMake_VERSION_SOURCE "")
if(EXISTS ${CMake_SOURCE_DIR}/.git)
- find_program(GIT_EXECUTABLE NAMES git git.cmd)
- mark_as_advanced(GIT_EXECUTABLE)
- if(GIT_EXECUTABLE)
+ find_package(Git QUIET)
+ if(GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --verify -q --short=4 HEAD
OUTPUT_VARIABLE head