From 918fd56324bbfb0d3e6bfffaaa608c64b62ef45b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 3 Jul 2012 21:26:36 +0200 Subject: [PATCH] centralize handling of QT_BUILD_PARTS Change-Id: I33b8c3958a102d87461ad887fa5749bd9a6dc037 Reviewed-by: Sergio Ahumada Reviewed-by: Marius Storm-Olsen --- mkspecs/features/qt_parts.prf | 44 +++++++++++++++++++++++++++++++++++ qtbase.pro | 31 +----------------------- 2 files changed, 45 insertions(+), 30 deletions(-) create mode 100644 mkspecs/features/qt_parts.prf 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 {