File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ set(__get_git_version INCLUDED)
2121function (get_git_version var )
2222 if (GIT_EXECUTABLE)
2323 execute_process (COMMAND ${GIT_EXECUTABLE} describe --match "v[0-9]*.[0-9]*.[0-9]*" --abbrev=8
24+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
2425 RESULT_VARIABLE status
2526 OUTPUT_VARIABLE GIT_VERSION
2627 ERROR_QUIET )
@@ -33,9 +34,11 @@ function(get_git_version var)
3334
3435 # Work out if the repository is dirty
3536 execute_process (COMMAND ${GIT_EXECUTABLE} update-index -q --refresh
37+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
3638 OUTPUT_QUIET
3739 ERROR_QUIET )
3840 execute_process (COMMAND ${GIT_EXECUTABLE} diff-index --name-only HEAD --
41+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
3942 OUTPUT_VARIABLE GIT_DIFF_INDEX
4043 ERROR_QUIET )
4144 string (COMPARE NOTEQUAL "${GIT_DIFF_INDEX} " "" GIT_DIRTY)
You can’t perform that action at this time.
0 commit comments