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.

Change-Id: Icddbae3a4d9a8823551106f089dbbff2c935ff35
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b6dfb5e295)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Volker Hilsheimer
2020-12-01 17:50:02 +01:00
committed by Qt Cherry-pick Bot
parent 15b37f55a6
commit 367b81813b

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(