mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 00:11:07 -06:00
CMakeVersion: Use FindGit module to find Git
We now require at least CMake 3.1 to build, and that has the FindGit module.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user