mirror of
https://github.com/ceph/ceph
synced 2026-08-01 22:45:39 +00:00
Merge pull request #54963 from DimStar77/cmake328
cmake: Ensure git exists before executing it Signed-off-by: Kefu Chai <tchaikov@gmail.com>
This commit is contained in:
commit
6850bc28ae
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user