factor out qt_docs_targets.prf
instead of letting *every* qmake-based project have recursive docs targets, let qt modules "subscribe" to it explicitly by having load(qt_build_config) in their .qmake.conf (which they already do). Change-Id: I97b74591fd0c4bd5f8b08c5f550df9c7eef2f556 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
This commit is contained in:
parent
c0764ab9a1
commit
bc6228c3f4
@ -56,56 +56,3 @@ QMAKE_LIBDIR += $$QMAKE_LIBDIR_POST
|
|||||||
check.depends = first # `make check' implies build
|
check.depends = first # `make check' implies build
|
||||||
QMAKE_EXTRA_TARGETS += check
|
QMAKE_EXTRA_TARGETS += check
|
||||||
}
|
}
|
||||||
|
|
||||||
!contains(QMAKE_EXTRA_TARGETS, docs) {
|
|
||||||
contains(TEMPLATE, subdirs) {
|
|
||||||
prepare_docs {
|
|
||||||
prepareRecursiveTarget(prepare_docs)
|
|
||||||
prepareRecursiveTarget(generate_docs)
|
|
||||||
html_docs.commands = $(MAKE) -f $(MAKEFILE) prepare_docs && $(MAKE) -f $(MAKEFILE) generate_docs
|
|
||||||
} else {
|
|
||||||
prepareRecursiveTarget(html_docs)
|
|
||||||
}
|
|
||||||
prepareRecursiveTarget(qch_docs)
|
|
||||||
prepareRecursiveTarget(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")
|
|
||||||
qtPrepareTool(QDOC, qdoc)
|
|
||||||
for(index, QMAKE_DOCS_INDEX):QDOC_INDEX += -indexdir $$index
|
|
||||||
!isEmpty(QMAKE_DOCS_OUTPUTDIR):QMAKE_DOCS_OPTIONS += -outputdir $$QMAKE_DOCS_OUTPUTDIR
|
|
||||||
!isEmpty(QMAKE_DOCS_INSTALLDIR):QMAKE_DOCS_OPTIONS += -installdir $$QMAKE_DOCS_INSTALLDIR
|
|
||||||
doc_command = $$QDOC $$QMAKE_DOCS_OPTIONS $$QDOC_INDEX $$QMAKE_DOCS
|
|
||||||
prepare_docs {
|
|
||||||
prepare_docs.commands += $$doc_command -prepare -no-link-errors
|
|
||||||
generate_docs.commands += $$doc_command -generate
|
|
||||||
html_docs.depends += generate_docs
|
|
||||||
} else {
|
|
||||||
html_docs.commands += $$doc_command
|
|
||||||
}
|
|
||||||
|
|
||||||
qtPrepareTool(QHELPGENERATOR, qhelpgenerator)
|
|
||||||
isEmpty(QMAKE_DOCS_TARGET): QMAKE_DOCS_TARGET = $$basename(QMAKE_DOCS_OUTPUTDIR)
|
|
||||||
qch_docs.commands = $$QHELPGENERATOR $$QMAKE_DOCS_OUTPUTDIR/$${QMAKE_DOCS_TARGET}.qhp -o $$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch
|
|
||||||
}
|
|
||||||
}
|
|
||||||
docs.commands = $(MAKE) -f $(MAKEFILE) html_docs && $(MAKE) -f $(MAKEFILE) qch_docs
|
|
||||||
QMAKE_EXTRA_TARGETS += html_docs qch_docs docs
|
|
||||||
prepare_docs: QMAKE_EXTRA_TARGETS += prepare_docs generate_docs
|
|
||||||
}
|
|
||||||
|
|
||||||
!contains(QMAKE_EXTRA_TARGETS, install_docs) {
|
|
||||||
contains(TEMPLATE, subdirs) {
|
|
||||||
prepareRecursiveTarget(install_html_docs)
|
|
||||||
prepareRecursiveTarget(uninstall_html_docs)
|
|
||||||
prepareRecursiveTarget(install_qch_docs)
|
|
||||||
prepareRecursiveTarget(uninstall_qch_docs)
|
|
||||||
prepareRecursiveTarget(install_docs)
|
|
||||||
prepareRecursiveTarget(uninstall_docs)
|
|
||||||
}
|
|
||||||
QMAKE_EXTRA_TARGETS += \
|
|
||||||
install_html_docs uninstall_html_docs \
|
|
||||||
install_qch_docs uninstall_qch_docs \
|
|
||||||
install_docs uninstall_docs
|
|
||||||
}
|
|
||||||
|
@ -27,7 +27,7 @@ mac {
|
|||||||
|
|
||||||
CONFIG += \
|
CONFIG += \
|
||||||
create_prl link_prl \
|
create_prl link_prl \
|
||||||
prepare_docs \
|
prepare_docs qt_docs_targets \
|
||||||
no_private_qt_headers_warning QTDIR_build \
|
no_private_qt_headers_warning QTDIR_build \
|
||||||
# Qt modules get compiled without exceptions enabled by default.
|
# Qt modules get compiled without exceptions enabled by default.
|
||||||
# However, testcases should be still built with exceptions.
|
# However, testcases should be still built with exceptions.
|
||||||
|
52
mkspecs/features/qt_docs_targets.prf
Normal file
52
mkspecs/features/qt_docs_targets.prf
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
!contains(QMAKE_EXTRA_TARGETS, docs) {
|
||||||
|
contains(TEMPLATE, subdirs) {
|
||||||
|
prepare_docs {
|
||||||
|
prepareRecursiveTarget(prepare_docs)
|
||||||
|
prepareRecursiveTarget(generate_docs)
|
||||||
|
html_docs.commands = $(MAKE) -f $(MAKEFILE) prepare_docs && $(MAKE) -f $(MAKEFILE) generate_docs
|
||||||
|
} else {
|
||||||
|
prepareRecursiveTarget(html_docs)
|
||||||
|
}
|
||||||
|
prepareRecursiveTarget(qch_docs)
|
||||||
|
prepareRecursiveTarget(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")
|
||||||
|
qtPrepareTool(QDOC, qdoc)
|
||||||
|
for(index, QMAKE_DOCS_INDEX):QDOC_INDEX += -indexdir $$index
|
||||||
|
!isEmpty(QMAKE_DOCS_OUTPUTDIR):QMAKE_DOCS_OPTIONS += -outputdir $$QMAKE_DOCS_OUTPUTDIR
|
||||||
|
!isEmpty(QMAKE_DOCS_INSTALLDIR):QMAKE_DOCS_OPTIONS += -installdir $$QMAKE_DOCS_INSTALLDIR
|
||||||
|
doc_command = $$QDOC $$QMAKE_DOCS_OPTIONS $$QDOC_INDEX $$QMAKE_DOCS
|
||||||
|
prepare_docs {
|
||||||
|
prepare_docs.commands += $$doc_command -prepare -no-link-errors
|
||||||
|
generate_docs.commands += $$doc_command -generate
|
||||||
|
html_docs.depends += generate_docs
|
||||||
|
} else {
|
||||||
|
html_docs.commands += $$doc_command
|
||||||
|
}
|
||||||
|
|
||||||
|
qtPrepareTool(QHELPGENERATOR, qhelpgenerator)
|
||||||
|
isEmpty(QMAKE_DOCS_TARGET): QMAKE_DOCS_TARGET = $$basename(QMAKE_DOCS_OUTPUTDIR)
|
||||||
|
qch_docs.commands = $$QHELPGENERATOR $$QMAKE_DOCS_OUTPUTDIR/$${QMAKE_DOCS_TARGET}.qhp -o $$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch
|
||||||
|
}
|
||||||
|
}
|
||||||
|
docs.commands = $(MAKE) -f $(MAKEFILE) html_docs && $(MAKE) -f $(MAKEFILE) qch_docs
|
||||||
|
QMAKE_EXTRA_TARGETS += html_docs qch_docs docs
|
||||||
|
prepare_docs: QMAKE_EXTRA_TARGETS += prepare_docs generate_docs
|
||||||
|
}
|
||||||
|
|
||||||
|
!contains(QMAKE_EXTRA_TARGETS, install_docs) {
|
||||||
|
contains(TEMPLATE, subdirs) {
|
||||||
|
prepareRecursiveTarget(install_html_docs)
|
||||||
|
prepareRecursiveTarget(uninstall_html_docs)
|
||||||
|
prepareRecursiveTarget(install_qch_docs)
|
||||||
|
prepareRecursiveTarget(uninstall_qch_docs)
|
||||||
|
prepareRecursiveTarget(install_docs)
|
||||||
|
prepareRecursiveTarget(uninstall_docs)
|
||||||
|
}
|
||||||
|
QMAKE_EXTRA_TARGETS += \
|
||||||
|
install_html_docs uninstall_html_docs \
|
||||||
|
install_qch_docs uninstall_qch_docs \
|
||||||
|
install_docs uninstall_docs
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user