Don't search for Git ourselves - CMake can handle it now.
This commit is contained in:
parent
893e8b4371
commit
880306f6d6
@ -288,21 +288,10 @@ set(OPENCV_EXTRA_MODULES_PATH "" CACHE PATH "Where to look for additional OpenCV
|
|||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
# Autodetect if we are in a GIT repository
|
# Autodetect if we are in a GIT repository
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
find_package(Git QUIET)
|
||||||
|
|
||||||
# don't use FindGit because it requires CMake 2.8.2
|
if(GIT_FOUND)
|
||||||
set(git_names git eg) # eg = easy git
|
execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags --always --dirty --match "2.[0-9].[0-9]*"
|
||||||
# Prefer .cmd variants on Windows unless running in a Makefile in the MSYS shell
|
|
||||||
if(CMAKE_HOST_WIN32)
|
|
||||||
if(NOT CMAKE_GENERATOR MATCHES "MSYS")
|
|
||||||
set(git_names git.cmd git eg.cmd eg)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_host_program(GIT_EXECUTABLE NAMES ${git_names} PATH_SUFFIXES Git/cmd Git/bin DOC "git command line client")
|
|
||||||
mark_as_advanced(GIT_EXECUTABLE)
|
|
||||||
|
|
||||||
if(GIT_EXECUTABLE)
|
|
||||||
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --always --dirty --match "2.[0-9].[0-9]*"
|
|
||||||
WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
|
WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
|
||||||
OUTPUT_VARIABLE OPENCV_VCSVERSION
|
OUTPUT_VARIABLE OPENCV_VCSVERSION
|
||||||
RESULT_VARIABLE GIT_RESULT
|
RESULT_VARIABLE GIT_RESULT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user