Handle case where ioq3 is present as a git submodule
This commit is contained in:
parent
139695d196
commit
c891c337cb
|
|
@ -6,6 +6,17 @@ function(add_git_dependency SOURCE_FILE)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# If we're a submodule, .git won't be a directory
|
||||||
|
if(NOT IS_DIRECTORY ${GIT_DIR})
|
||||||
|
file(READ ${GIT_DIR} GIT_FILE_CONTENT)
|
||||||
|
string(REGEX MATCH "gitdir: (.+)" MATCHED_PATH ${GIT_FILE_CONTENT})
|
||||||
|
if(NOT MATCHED_PATH)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
string(STRIP ${CMAKE_MATCH_1} GIT_DIR)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(GIT_FILES)
|
set(GIT_FILES)
|
||||||
list(APPEND GIT_FILES ${GIT_DIR}/HEAD)
|
list(APPEND GIT_FILES ${GIT_DIR}/HEAD)
|
||||||
list(APPEND GIT_FILES ${GIT_DIR}/packed-refs)
|
list(APPEND GIT_FILES ${GIT_DIR}/packed-refs)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user