From d36aecab66bf9279bf5c7e1fef069de5ae9f9576 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 25 Nov 2011 17:01:10 +0300 Subject: [PATCH] Fix git id detection. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 806299ab0..ac401dd58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -741,7 +741,7 @@ IF(HG) # Maybe this is git copy FIND_PROGRAM(GIT "git") IF(GIT) - EXECUTE_PROCESS(COMMAND "${GIT}" branch -v OUTPUT_VARIABLE GIT_ID ERROR_QUIET) + EXECUTE_PROCESS(COMMAND "${GIT}" --git-dir=${CMAKE_SOURCE_DIR}/.git branch -v OUTPUT_VARIABLE GIT_ID ERROR_QUIET) IF(GIT_ID) STRING(REGEX REPLACE "^. [0-9a-z]+ ([0-9a-f]+) .*" \\1 ID "${GIT_ID}") ENDIF(GIT_ID) @@ -761,7 +761,7 @@ ELSE(HG) # Maybe this is git copy FIND_PROGRAM(GIT "git") IF(GIT) - EXECUTE_PROCESS(COMMAND "${GIT}" branch -v OUTPUT_VARIABLE GIT_ID ERROR_QUIET) + EXECUTE_PROCESS(COMMAND "${GIT}" --git-dir=${CMAKE_SOURCE_DIR}/.git branch -v OUTPUT_VARIABLE GIT_ID ERROR_QUIET) IF(GIT_ID) STRING(REGEX REPLACE "^. [0-9a-z]+ ([0-9a-f]+) .*" \\1 ID "${GIT_ID}") ENDIF(GIT_ID) -- 2.39.5