aboutsummaryrefslogtreecommitdiffstats
path: root/submodules.pri
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2017-02-09 10:53:13 +0100
committerEike Ziller <eike.ziller@qt.io>2017-02-16 08:26:32 +0000
commit783e0014a86d4f0ba0496ed65f864a29b9815963 (patch)
treed58a92c954b575e9624a085ea3b208e8a1cee93d /submodules.pri
parent750bb2981cf3cec5c6ccdf0b37a4ea3bc306457c (diff)
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-<module> Change-Id: I4e29027169ce7260b029eef33789814fa20ffc99 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Artur Shepilko <artur.shepilko@nomadbyte.com> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'submodules.pri')
-rw-r--r--submodules.pri62
1 files changed, 62 insertions, 0 deletions
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
+}