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 <lars.knoll@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
This commit is contained in:
Marius Storm-Olsen 2012-05-07 13:54:52 +02:00
parent b3f9978a4d
commit 9fde9ab167
13 changed files with 51 additions and 16 deletions

View File

@ -1,4 +1,6 @@
TEMPLATE = subdirs
CONFIG += no_docs_target
SUBDIRS = \
network \
statemachine \

View File

@ -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
}

View File

@ -16,6 +16,9 @@ load(qt_module_config)
HEADERS += $$QT_SOURCE_TREE/src/corelib/qtcoreversion.h
QMAKE_DOCS = $$PWD/doc/qtcore.qdocconf
QMAKE_DOCS_INDEX = ../../doc
include(animation/animation.pri)
include(arch/arch.pri)
include(global/global.pri)
@ -30,7 +33,6 @@ include(codecs/codecs.pri)
include(statemachine/statemachine.pri)
include(mimetypes/mimetypes.pri)
include(xml/xml.pri)
include(doc/doc.pri)
mac|darwin {
!ios {

View File

@ -1,3 +0,0 @@
qtPrepareTool(QDOC, qdoc)
docs.commands += $$QDOC $$QT.core.sources/doc/qtcore.qdocconf
QMAKE_EXTRA_TARGETS += docs

View File

@ -1,3 +0,0 @@
qtPrepareTool(QDOC, qdoc)
docs.commands += $$QDOC $$QT.network.sources/doc/qtnetwork.qdocconf
QMAKE_EXTRA_TARGETS += docs

View File

@ -24,9 +24,11 @@ load(qt_module_config)
HEADERS += $$QT_SOURCE_TREE/src/network/qtnetworkversion.h
QMAKE_DOCS = $$PWD/doc/qtnetwork.qdocconf
QMAKE_DOCS_INDEX = ../../doc
include(access/access.pri)
include(bearer/bearer.pri)
include(doc/doc.pri)
include(kernel/kernel.pri)
include(socket/socket.pri)
include(ssl/ssl.pri)

View File

@ -1,3 +0,0 @@
qtPrepareTool(QDOC, qdoc)
docs.commands += $$QDOC $$QT.sql.sources/doc/qtsql.qdocconf
QMAKE_EXTRA_TARGETS += docs

View File

@ -21,7 +21,9 @@ DEFINES += QT_NO_CAST_FROM_ASCII
PRECOMPILED_HEADER = ../corelib/global/qt_pch.h
SQL_P = sql
include(doc/doc.pri)
QMAKE_DOCS = $$PWD/doc/qtsql.qdocconf
QMAKE_DOCS_INDEX = ../../doc
include(kernel/kernel.pri)
include(drivers/drivers.pri)
include(models/models.pri)

View File

@ -127,3 +127,6 @@ freeze_target.target = freeze
freeze_target.commands =
freeze_target.depends = first
QMAKE_EXTRA_TARGETS += freeze_target
docs.commands =
docs.depends = first
QMAKE_EXTRA_TARGETS += docs

View File

@ -116,4 +116,10 @@ QMAKE_EXTRA_TARGETS += html-docs qch-docs
target.path = $$[QT_HOST_BINS]
INSTALLS += target
# Ensure that qdoc is built before we generate the docs
docs.commands =
docs.depends = first
QMAKE_EXTRA_TARGET += docs
load(qt_targets)

View File

@ -1,3 +0,0 @@
qtPrepareTool(QDOC, qdoc)
docs.commands += $$QDOC $$QT.xml.sources/doc/qtxml.qdocconf
QMAKE_EXTRA_TARGETS += docs

View File

@ -16,6 +16,9 @@ load(qt_module_config)
HEADERS += $$QT_SOURCE_TREE/src/xml/qtxmlversion.h
QMAKE_DOCS = $$PWD/doc/qtxml.qdocconf
QMAKE_DOCS_INDEX = ../../doc
PRECOMPILED_HEADER = ../corelib/global/qt_pch.h
win32-borland {
@ -23,6 +26,5 @@ win32-borland {
QMAKE_CXXFLAGS_WARN_ON += -w-use
}
include(doc/doc.pri)
include(dom/dom.pri)
include(sax/sax.pri)

View File

@ -1,4 +1,5 @@
TEMPLATE = subdirs
CONFIG += no_docs_target
SUBDIRS = auto
# benchmarks in debug mode is rarely sensible