Support absorbed and unabsorbed submodules

Modern git usage for submodules is that the git object storage is absorbed
into the supermodule (see git submodule absorbgitdirs).

Handle both cases when trying to locate the gitdir for the target module.

Pick-to: 6.0
Change-Id: Icddbae3a4d9a8823551106f089dbbff2c935ff35
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Volker Hilsheimer 2020-12-01 17:50:02 +01:00
parent a60501e35b
commit b6dfb5e295
1 changed files with 4 additions and 0 deletions

View File

@ -164,6 +164,10 @@ function(qt_internal_get_dependency dependent dependency)
)
string(FIND "${git_stdout}" "${module}" index)
string(SUBSTRING "${git_stdout}" 0 ${index} gitdir)
string(FIND "${gitdir}" ".git/modules" index)
if(index GREATER -1) # submodules have not been absorbed
string(SUBSTRING "${gitdir}" 0 ${index} gitdir)
endif()
message(DEBUG "Will look for clones in ${gitdir}")
execute_process(