diff options
author | Brad King <brad.king@kitware.com> | 2019-07-25 12:24:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-07-29 15:25:44 (GMT) |
commit | 74ff80323c23a41b4b311b0cf67d6f5f59034d08 (patch) | |
tree | 61a2247d8a15bf71c96885aa018d8a1272068f6c /Source/CMakeVersion.cmake | |
parent | e1e7986c00912a89b644ff60a8e63189f8ba1ac5 (diff) | |
download | CMake-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.cmake | 5 |
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 |