mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-20 05:12:07 -05: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.
|
# Try to identify the current development source version.
|
||||||
set(CMake_VERSION_SOURCE "")
|
set(CMake_VERSION_SOURCE "")
|
||||||
if(EXISTS ${CMake_SOURCE_DIR}/.git)
|
if(EXISTS ${CMake_SOURCE_DIR}/.git)
|
||||||
find_program(GIT_EXECUTABLE NAMES git git.cmd)
|
find_package(Git QUIET)
|
||||||
mark_as_advanced(GIT_EXECUTABLE)
|
if(GIT_FOUND)
|
||||||
if(GIT_EXECUTABLE)
|
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${GIT_EXECUTABLE} rev-parse --verify -q --short=4 HEAD
|
COMMAND ${GIT_EXECUTABLE} rev-parse --verify -q --short=4 HEAD
|
||||||
OUTPUT_VARIABLE head
|
OUTPUT_VARIABLE head
|
||||||
|
|||||||
Reference in New Issue
Block a user