summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKefu Chai <tchaikov@gmail.com>2024-02-17 16:18:23 +0100
committerGitHub <noreply@github.com>2024-02-17 16:18:23 +0100
commit6850bc28ae3fc583b01c56a0c95b424227ca3820 (patch)
tree35f47242ec622b15fc252f214d4f68e34d73b8c5
parentMerge pull request #55605 from ronen-fr/wip-rf-warns0224 (diff)
parentcmake: Ensure git exists before executing it (diff)
downloadceph-19.3.0.tar.xz
ceph-19.3.0.zip
Merge pull request #54963 from DimStar77/cmake328v19.3.0
cmake: Ensure git exists before executing it Signed-off-by: Kefu Chai <tchaikov@gmail.com>
-rw-r--r--cmake/modules/CTags.cmake5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmake/modules/CTags.cmake b/cmake/modules/CTags.cmake
index ee1912f3c5a..13fe9fcb32d 100644
--- a/cmake/modules/CTags.cmake
+++ b/cmake/modules/CTags.cmake
@@ -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