From 783e0014a86d4f0ba0496ed65f864a29b9815963 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 9 Feb 2017 10:53:13 +0100 Subject: Add Fossil SCM plugin submodules.pri is derived from qt5/qt.pro, starting from "# Extract submodules", with a few differences: - removed setting QMAKE_INTERNAL_INCLUDED_FILES - renamed QT_BUILD_MODULES and QT_SKIP_MODULES to QTC_* and removed corresponding argument parsing - removed handling of module.$${mod}.qt - made it look for the module .pro file in the module.$${mod}.path - renamed the sub targets in the Makefile to sub- Change-Id: I4e29027169ce7260b029eef33789814fa20ffc99 Reviewed-by: Christian Kandeler Reviewed-by: Oswald Buddenhagen Reviewed-by: Artur Shepilko Reviewed-by: Eike Ziller --- submodules.pri | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 submodules.pri (limited to 'submodules.pri') diff --git a/submodules.pri b/submodules.pri new file mode 100644 index 0000000..86221a5 --- /dev/null +++ b/submodules.pri @@ -0,0 +1,62 @@ +# 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") + } + } +} + +modules = $$sort_depends(modules, module., .depends .recommends) +modules = $$reverse(modules) +for (mod, modules) { + deps = $$eval(module.$${mod}.depends) + recs = $$eval(module.$${mod}.recommends) + for (d, $$list($$deps $$recs)): \ + !contains(modules, $$d): \ + error("'$$mod' depends on undeclared '$$d'.") + + contains(QTC_SKIP_MODULES, $$mod): \ + next() + !isEmpty(QTC_BUILD_MODULES):!contains(QTC_BUILD_MODULES, $$mod): \ + next() + + path = $$eval(module.$${mod}.path) + project = $$eval(module.$${mod}.project) + isEmpty(project) { + !exists($$path/$$section(path, /, -1).pro): \ + next() + $${mod}.subdir = $$path + } else { + !exists($$path/$$project): \ + next() + $${mod}.file = $$path/$$project + $${mod}.makefile = Makefile + } + $${mod}.target = sub-$$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 +} -- cgit v1.2.3