summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-07-03 21:26:36 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-05 21:11:27 +0200
commit918fd56324bbfb0d3e6bfffaaa608c64b62ef45b (patch)
treedd719a52a8c7b65de9194a222bfd732ade23bd81
parent8d2c59774db5fce773b90369ce2f5ef7db0be78d (diff)
downloadqtbase-918fd56324bbfb0d3e6bfffaaa608c64b62ef45b.tar.gz
centralize handling of QT_BUILD_PARTS
Change-Id: I33b8c3958a102d87461ad887fa5749bd9a6dc037 Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
-rw-r--r--mkspecs/features/qt_parts.prf44
-rw-r--r--qtbase.pro31
2 files changed, 45 insertions, 30 deletions
diff --git a/mkspecs/features/qt_parts.prf b/mkspecs/features/qt_parts.prf
new file mode 100644
index 0000000000..9257f5612f
--- /dev/null
+++ b/mkspecs/features/qt_parts.prf
@@ -0,0 +1,44 @@
+load(qt_build_config)
+
+TEMPLATE = subdirs
+
+sub_src.subdir = src
+sub_src.target = sub-src
+SUBDIRS = sub_src
+
+exists(tools/tools.pro) {
+ sub_tools.subdir = tools
+ sub_tools.target = sub-tools
+ sub_tools.depends = sub_src
+ !contains(QT_BUILD_PARTS, tools): sub_tools.CONFIG = no_default_target no_default_install
+ SUBDIRS += sub_tools
+}
+
+exists(examples/examples.pro) {
+ sub_examples.subdir = examples
+ sub_examples.target = sub-examples
+ sub_examples.depends = sub_src
+ !contains(QT_BUILD_PARTS, examples): sub_examples.CONFIG = no_default_target no_default_install
+ SUBDIRS += sub_examples
+}
+
+# Some modules still have these
+exists(demos/demos.pro) {
+ sub_demos.subdir = examples
+ sub_demos.target = sub-examples
+ sub_demos.depends = sub_src
+ !contains(QT_BUILD_PARTS, examples): sub_demos.CONFIG = no_default_target no_default_install
+ SUBDIRS += sub_demos
+}
+
+exists(tests/tests.pro) {
+ sub_tests.subdir = tests
+ sub_tests.target = sub-tests
+ sub_tests.depends = sub_src # The tests may have a run-time only dependency on tools
+ sub_tests.CONFIG = no_default_install
+ !contains(QT_BUILD_PARTS, tests): sub_tests.CONFIG += no_default_target
+ SUBDIRS += sub_tests
+}
+
+QT_BUILD_PARTS -= libs tools examples tests
+!isEmpty(QT_BUILD_PARTS): warning("Unknown build part(s): $$QT_BUILD_PARTS")
diff --git a/qtbase.pro b/qtbase.pro
index 185270a73f..dc5dbf7503 100644
--- a/qtbase.pro
+++ b/qtbase.pro
@@ -2,39 +2,10 @@
# Main projectfile
#####################################################################
-CONFIG += ordered
-TEMPLATE = subdirs
+load(qt_parts)
cross_compile: CONFIG += nostrip
-module_qtbase_tests.subdir = tests
-module_qtbase_tests.target = module-qtbase-tests
-module_qtbase_tests.depends = module_qtbase_src
-module_qtbase_tests.CONFIG = no_default_install
-
-#process the projects
-PROJECTS=$$eval($$list($$lower($$unique(QT_BUILD_PARTS))))
-# note that the order matters for these blocks!
-contains(PROJECTS, qmake) {
- PROJECTS -= qmake
- # nothing to be done
-}
-contains(PROJECTS, libs) {
- PROJECTS -= libs
- SUBDIRS += src
-}
-contains(PROJECTS, examples) {
- PROJECTS -= examples
- SUBDIRS += examples
-}
-contains(PROJECTS, tests) {
- PROJECTS -= tests
- SUBDIRS += module_qtbase_tests
-}
-!isEmpty(PROJECTS) {
- message(Unknown PROJECTS: $$PROJECTS)
-}
-
confclean.depends += clean
confclean.commands =
unix {