mirror of
git://code.qt.io/qt/qt5.git
synced 2026-02-02 03:36:54 +08:00
instead, re-use the (also custom) 'project' property with the magic value '-' to flag modules which contain no project files at all. Change-Id: I33163c098852e1b79ad698115aac98217efe1157 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Aapo Keskimolo <aapo.keskimolo@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
75 lines
2.0 KiB
Prolog
75 lines
2.0 KiB
Prolog
# Create the super cache so modules will add themselves to it.
|
|
cache(, super)
|
|
|
|
CONFIG += build_pass # hack to disable the .qmake.super auto-add
|
|
load(qt_build_config)
|
|
CONFIG -= build_pass # unhack, as it confuses Qt Creator
|
|
|
|
TEMPLATE = subdirs
|
|
|
|
# Extract submodules from .gitmodules.
|
|
lines = $$cat(.gitmodules, lines)
|
|
for (line, lines) {
|
|
mod = $$replace(line, "^\\[submodule \"([^\"]+)\"\\]$", \\1)
|
|
!equals(mod, $$line) {
|
|
module = $$mod
|
|
modules += $$mod
|
|
} else {
|
|
prop = $$replace(line, "^$$escape_expand(\\t)([^ =]+) *=.*$", \\1)
|
|
!equals(prop, $$line) {
|
|
val = $$replace(line, "^[^=]+= *", )
|
|
module.$${module}.$$prop = $$split(val)
|
|
} else {
|
|
error("Malformed line in .gitmodules: $$line")
|
|
}
|
|
}
|
|
}
|
|
QMAKE_INTERNAL_INCLUDED_FILES += $$PWD/.gitmodules
|
|
|
|
modules = $$sort_depends(modules, module., .depends .recommends .serialize)
|
|
modules = $$reverse(modules)
|
|
for (mod, modules) {
|
|
project = $$eval(module.$${mod}.project)
|
|
equals(project, -): \
|
|
next()
|
|
|
|
deps = $$eval(module.$${mod}.depends)
|
|
recs = $$eval(module.$${mod}.recommends) $$eval(module.$${mod}.serialize)
|
|
for (d, $$list($$deps $$recs)): \
|
|
!contains(modules, $$d): \
|
|
error("'$$mod' depends on undeclared '$$d'.")
|
|
|
|
contains(QT_SKIP_MODULES, $$mod): \
|
|
next()
|
|
!isEmpty(QT_BUILD_MODULES):!contains(QT_BUILD_MODULES, $$mod): \
|
|
next()
|
|
|
|
isEmpty(project) {
|
|
!exists($$mod/$${mod}.pro): \
|
|
next()
|
|
$${mod}.subdir = $$mod
|
|
} else {
|
|
!exists($$mod/$$project): \
|
|
next()
|
|
$${mod}.file = $$mod/$$project
|
|
$${mod}.makefile = Makefile
|
|
}
|
|
$${mod}.target = module-$$mod
|
|
|
|
for (d, deps) {
|
|
!contains(SUBDIRS, $$d) {
|
|
$${mod}.target =
|
|
break()
|
|
}
|
|
$${mod}.depends += $$d
|
|
}
|
|
isEmpty($${mod}.target): \
|
|
next()
|
|
for (d, recs) {
|
|
contains(SUBDIRS, $$d): \
|
|
$${mod}.depends += $$d
|
|
}
|
|
|
|
SUBDIRS += $$mod
|
|
}
|