cmake: use CMAKE_CURRENT_LIST_DIR for git version

This commit is contained in:
selsta 2021-10-19 17:26:20 +02:00
parent 5aae00ac79
commit 5180610c4b
No known key found for this signature in database
GPG Key ID: 2EA0A99A8B07AE5E
1 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@
function (get_version_tag_from_git GIT)
execute_process(COMMAND "${GIT}" rev-parse --short=9 HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
RESULT_VARIABLE RET
OUTPUT_VARIABLE COMMIT
OUTPUT_STRIP_TRAILING_WHITESPACE)
@ -49,7 +49,7 @@ function (get_version_tag_from_git GIT)
# Get all the tags
execute_process(COMMAND "${GIT}" tag -l --points-at HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
RESULT_VARIABLE RET
OUTPUT_VARIABLE TAG
OUTPUT_STRIP_TRAILING_WHITESPACE)