From 6f0f8afea0ae3fba81dc8e31fdbdcbead4fc117c Mon Sep 17 00:00:00 2001 From: bergmann Date: Fri, 2 Aug 2019 11:13:14 +0200 Subject: [PATCH] * Fixed bug: Git tag is always read from the root repository. Now it will be read from the current cmake source directory. --- git_helper.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git_helper.cmake b/git_helper.cmake index 513a087..ea9bc79 100644 --- a/git_helper.cmake +++ b/git_helper.cmake @@ -28,17 +28,17 @@ Function ( GitGetVersion GIT_ROOT OUT_MAJOR OUT_MINOR OUT_PATCH OUT_BUILD OUT_HA EndIf ( ) # Find the latest git tag - GitExecute ( "git describe --tags --abbrev=1 --match v[0-9].[0-9]* HEAD" False TAG SUCCESS ) + GitExecute ( "git -C ${CMAKE_CURRENT_SOURCE_DIR} describe --tags --abbrev=1 --match v[0-9].[0-9]* HEAD" False TAG SUCCESS ) If ( NOT ${SUCCESS} ) Return ( ) EndIf ( ) - GitExecute ( "git status -s -uall" True DIRTY SUCCESS ) + GitExecute ( "git -C ${CMAKE_CURRENT_SOURCE_DIR} status -s -uall" True DIRTY SUCCESS ) If ( NOT ${SUCCESS} ) Return ( ) EndIf ( ) - GitExecute ( "git rev-parse HEAD" True HASH SUCCESS ) + GitExecute ( "git -C ${CMAKE_CURRENT_SOURCE_DIR} rev-parse HEAD" True HASH SUCCESS ) If ( NOT ${SUCCESS} ) Return ( ) EndIf ( )