Skip to content

Commit

Permalink
Merge pull request ceph#54963 from DimStar77/cmake328
Browse files Browse the repository at this point in the history
cmake: Ensure git exists before executing it

Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov authored Feb 17, 2024
2 parents 0ed764e + 8615731 commit 6850bc2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmake/modules/CTags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ find_program(CTAGS_EXECUTABLE ctags)
function(add_tags name)
cmake_parse_arguments(TAGS "" "SRC_DIR;TAG_FILE" "EXCLUDE_OPTS;EXCLUDES" ${ARGN})
set(excludes ${TAGS_EXCLUDES})
find_package(Git)
if(TAGS_EXCLUDE_OPTS)
# always respect EXCLUDES_OPTS
list(APPEND excludes ${TAGS_EXCLUDE_OPTS})
else()
elseif(Git_FOUND)
# exclude the submodules under SRC_DIR by default
execute_process(
COMMAND git config --file .gitmodules --get-regexp path
COMMAND ${GIT_EXECUTABLE} config --file .gitmodules --get-regexp path
COMMAND awk "/${TAGS_SRC_DIR}/ { print $2 }"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
RESULT_VARIABLE result_code
Expand Down

0 comments on commit 6850bc2

Please sign in to comment.