Skip to content

Commit 6850bc2

Browse files
authored
Merge pull request ceph#54963 from DimStar77/cmake328
cmake: Ensure git exists before executing it Signed-off-by: Kefu Chai <[email protected]>
2 parents 0ed764e + 8615731 commit 6850bc2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cmake/modules/CTags.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ find_program(CTAGS_EXECUTABLE ctags)
33
function(add_tags name)
44
cmake_parse_arguments(TAGS "" "SRC_DIR;TAG_FILE" "EXCLUDE_OPTS;EXCLUDES" ${ARGN})
55
set(excludes ${TAGS_EXCLUDES})
6+
find_package(Git)
67
if(TAGS_EXCLUDE_OPTS)
78
# always respect EXCLUDES_OPTS
89
list(APPEND excludes ${TAGS_EXCLUDE_OPTS})
9-
else()
10+
elseif(Git_FOUND)
1011
# exclude the submodules under SRC_DIR by default
1112
execute_process(
12-
COMMAND git config --file .gitmodules --get-regexp path
13+
COMMAND ${GIT_EXECUTABLE} config --file .gitmodules --get-regexp path
1314
COMMAND awk "/${TAGS_SRC_DIR}/ { print $2 }"
1415
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
1516
RESULT_VARIABLE result_code

0 commit comments

Comments
 (0)