From 9fde9ab167e52948d337de7fb7b871f7a1d75f43 Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Mon, 7 May 2012 13:54:52 +0200 Subject: Properly implement a 'make docs' target for subdirs and apps/libs Only call qdoc for projects which sets the QMAKE_DOCS variable to point to a qdocconf file. Exclude examples/ and tests/ from the qdoc run, by adding no_docs_target to CONFIG for those projects. Change-Id: Ic856c8f19db59309302d0602b3e99735609e525a Reviewed-by: Lars Knoll Reviewed-by: Oswald Buddenhagen Reviewed-by: Casper van Donderen --- mkspecs/features/default_post.prf | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'mkspecs') diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf index 874b4bf424..0a0fd8dfa8 100644 --- a/mkspecs/features/default_post.prf +++ b/mkspecs/features/default_post.prf @@ -64,3 +64,30 @@ QMAKE_LIBDIR += $$QMAKE_LIBDIR_POST QMAKE_EXTRA_TARGETS += check } +# Let every project have a 'docs' target +!contains(QMAKE_EXTRA_TARGETS, docs) { + contains(TEMPLATE, subdirs) { + # `make docs' should iterate through all subdirs + # (except those with no_default_target or no_docs_target) + !contains(CONFIG, no_docs_target):for(subdir, SUBDIRS) { + subdir_config = $$eval($${subdir}.CONFIG) + !contains(subdir_config, no_docs_target):!contains(subdir_config, no_default_target):docs.recurse += $$subdir + unset(subdir_config) + } + !isEmpty(docs.recurse) { + # setup the recurse target only when there is something to recurse into + docs.CONFIG = recursive + docs.recurse_target = docs + } + } else { + # apps and libs only generate docs if QMAKE_DOCS is set + !isEmpty(QMAKE_DOCS) { + !exists($$QMAKE_DOCS):error("Cannot find documentation specification file $$QMAKE_DOCS") + exists($$[QT_INSTALL_DOCS]):QMAKE_DOCS_INDEX *= $$[QT_INSTALL_DOCS] + qtPrepareTool(QDOC, qdoc) + for(index, QMAKE_DOCS_INDEX):QDOC_INDEX += -indexdir $$index + docs.commands += $$QDOC $$QMAKE_DOCS_OPTIONS $$QDOC_INDEX $$QMAKE_DOCS + } + } + QMAKE_EXTRA_TARGETS += docs +} -- cgit v1.2.3