Merge pull request #1323 from SpecLad:find-git
This commit is contained in:
commit
365def6090
@ -280,21 +280,10 @@ set(OPENCV_EXTRA_MODULES_PATH "" CACHE PATH "Where to look for additional OpenCV
|
||||
# ----------------------------------------------------------------------------
|
||||
# Autodetect if we are in a GIT repository
|
||||
# ----------------------------------------------------------------------------
|
||||
find_package(Git QUIET)
|
||||
|
||||
# don't use FindGit because it requires CMake 2.8.2
|
||||
set(git_names git eg) # eg = easy git
|
||||
# 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]*"
|
||||
if(GIT_FOUND)
|
||||
execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags --always --dirty --match "2.[0-9].[0-9]*"
|
||||
WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE OPENCV_VCSVERSION
|
||||
RESULT_VARIABLE GIT_RESULT
|
||||
|
Loading…
x
Reference in New Issue
Block a user