diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2012-10-17 14:13:19 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-18 21:01:09 +0200 |
commit | b9facbf34595464f677e12ef5100328d4c318380 (patch) | |
tree | 49198a333af6f423a69202550ac763f424a4a76b /mkspecs/features/qt_functions.prf | |
parent | d060620e6cd3c94e7e0ff809b21593b9c0da0be2 (diff) |
Refactor recursive target logic out of default_post into function
The qmake function prepareRecursiveTarget can now be used both by the
existing logic in default_post, as well as future recursive targets that
will be needed as part of the modularization of documentation builds.
Change-Id: Ibc72c3e224cb57c9f1796de3b04fda9de663dbb4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'mkspecs/features/qt_functions.prf')
-rw-r--r-- | mkspecs/features/qt_functions.prf | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index f614ad8f07..2d8f81bae1 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -267,3 +267,29 @@ defineTest(packagesExist) { return(true) } +# Prepares target that will iterate through all subdirs (except those +# with no_default_target or no_{name_of_target}_target. The prepared +# target must still be manually added to QMAKE_EXTRA_TARGETS. +defineTest(prepareRecursiveTarget) { + target = $$1 + no_$${target}_target: return() + + for(subdir, SUBDIRS) { + subdir_config = $$eval($${subdir}.CONFIG) + contains(subdir_config, no_default_target): next() + contains(subdir_config, no_$${target}_target): next() + + $${target}.recurse += $$subdir + } + + # Set up the recurse target only when there + # is something to recurse into. + isEmpty($${target}.recurse): return() + + $${target}.CONFIG = recursive + $${target}.recurse_target = $${target} + + export($${target}.recurse) + export($${target}.CONFIG) + export($${target}.recurse_target) +} |