centralize doc target related code
Change-Id: I710a7f2fc3422ec8ba5b8e90bfd92e7931092ad0 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: hjk <qthjk@ovi.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
parent
b1ff4712f2
commit
0d40958347
@ -1,7 +1,2 @@
|
||||
load(exclusive_builds)
|
||||
CONFIG = lex yacc warn_on debug exceptions depend_includepath $$CONFIG
|
||||
|
||||
# Populate the installdir which will be passed to qdoc in the default_post.prf
|
||||
# This allows a project to remove the installdir if need be, to trigger building online docs,
|
||||
# which Qt Creator does.
|
||||
QMAKE_DOCS_INSTALLDIR = $$[QT_INSTALL_DOCS]
|
||||
|
45
mkspecs/features/qt_docs.prf
Normal file
45
mkspecs/features/qt_docs.prf
Normal file
@ -0,0 +1,45 @@
|
||||
!exists($$QMAKE_DOCS): error("Cannot find documentation specification file $$QMAKE_DOCS")
|
||||
|
||||
load(qt_build_paths)
|
||||
QMAKE_DOCS_BASE_OUTDIR = $$MODULE_BASE_OUTDIR/doc
|
||||
|
||||
QMAKE_DOCS_TARGET = $$replace(QMAKE_DOCS, ^(.*/)?(.*)\\.qdocconf$, \\2)
|
||||
isEmpty(QMAKE_DOCS_TARGETDIR): QMAKE_DOCS_TARGETDIR = $$QMAKE_DOCS_TARGET
|
||||
QMAKE_DOCS_OUTPUTDIR = $$QMAKE_DOCS_BASE_OUTDIR/$$QMAKE_DOCS_TARGETDIR
|
||||
|
||||
qtPrepareTool(QDOC, qdoc)
|
||||
for(qmod, QMAKEMODULES): \
|
||||
QDOC += -indexdir $$section(qmod, /, 0, -3)/doc
|
||||
QDOC += -outputdir $$QMAKE_DOCS_OUTPUTDIR
|
||||
!build_online_docs: \
|
||||
QDOC += -installdir $$[QT_INSTALL_DOCS]
|
||||
doc_command = $$QDOC $$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
|
||||
}
|
||||
|
||||
!build_online_docs {
|
||||
qtPrepareTool(QHELPGENERATOR, qhelpgenerator)
|
||||
qch_docs.commands = $$QHELPGENERATOR $$QMAKE_DOCS_OUTPUTDIR/$${QMAKE_DOCS_TARGET}.qhp -o $$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch
|
||||
|
||||
inst_html_docs.files = $$QMAKE_DOCS_OUTPUTDIR
|
||||
inst_html_docs.path = $$[QT_INSTALL_DOCS]
|
||||
inst_html_docs.CONFIG += no_check_exist directory no_default_install
|
||||
INSTALLS += inst_html_docs
|
||||
|
||||
inst_qch_docs.files = $$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch
|
||||
inst_qch_docs.path = $$[QT_INSTALL_DOCS]
|
||||
inst_qch_docs.CONFIG += no_check_exist no_default_install
|
||||
INSTALLS += inst_qch_docs
|
||||
|
||||
install_html_docs.depends = install_inst_html_docs
|
||||
uninstall_html_docs.depends = uninstall_inst_html_docs
|
||||
install_qch_docs.depends = install_inst_qch_docs
|
||||
uninstall_qch_docs.depends = uninstall_inst_qch_docs
|
||||
install_docs.depends = install_html_docs install_qch_docs
|
||||
uninstall_docs.depends = uninstall_html_docs uninstall_qch_docs
|
||||
}
|
@ -12,23 +12,8 @@
|
||||
} 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
|
||||
# backwards compat hack
|
||||
load(qt_docs)
|
||||
}
|
||||
}
|
||||
docs.commands = $(MAKE) -f $(MAKEFILE) html_docs && $(MAKE) -f $(MAKEFILE) qch_docs
|
||||
|
@ -37,22 +37,3 @@ qt_install_module {
|
||||
warning("Project $$basename(_PRO_FILE_) is a module, but has not defined MODULE_PRI, which is required for Qt to expose the module to other projects.")
|
||||
}
|
||||
}
|
||||
|
||||
qt_install_module_docs {
|
||||
inst_html_docs.files = $$QMAKE_DOCS_OUTPUTDIR
|
||||
inst_html_docs.path = $$[QT_INSTALL_DOCS]
|
||||
inst_html_docs.CONFIG += no_check_exist directory no_default_install
|
||||
INSTALLS += inst_html_docs
|
||||
|
||||
inst_qch_docs.files = $$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch
|
||||
inst_qch_docs.path = $$[QT_INSTALL_DOCS]
|
||||
inst_qch_docs.CONFIG += no_check_exist no_default_install
|
||||
INSTALLS += inst_qch_docs
|
||||
|
||||
install_html_docs.depends = install_inst_html_docs
|
||||
uninstall_html_docs.depends = uninstall_inst_html_docs
|
||||
install_qch_docs.depends = install_inst_qch_docs
|
||||
uninstall_qch_docs.depends = uninstall_inst_qch_docs
|
||||
install_docs.depends = install_html_docs install_qch_docs
|
||||
uninstall_docs.depends = uninstall_html_docs uninstall_qch_docs
|
||||
}
|
||||
|
@ -113,18 +113,7 @@ win32:!wince*:exists($$[QT_INSTALL_PREFIX]/.qmake.cache): DLLDESTDIR = $$eval(QT
|
||||
CONFIG += qt warn_on depend_includepath
|
||||
CONFIG += qmake_cache target_qt
|
||||
|
||||
!isEmpty(QMAKE_DOCS) {
|
||||
doc_subdir = doc
|
||||
|
||||
unset(QMAKE_DOCS_INDEX)
|
||||
QMAKE_DOCS_BASE_OUTDIR = $$MODULE_BASE_OUTDIR/$$doc_subdir
|
||||
QMAKE_DOCS_OUTPUTDIR = $$QMAKE_DOCS_BASE_OUTDIR/qt$${MODULE}
|
||||
QMAKE_DOCS_TARGET = $$replace(QMAKE_DOCS, ^(.*/)?(.*)\\.qdocconf$, \\2)
|
||||
for(qmod, QMAKEMODULES): \
|
||||
QMAKE_DOCS_INDEX += $$section(qmod, /, 0, -3)/$$doc_subdir
|
||||
|
||||
CONFIG += qt_install_module_docs
|
||||
}
|
||||
QMAKE_DOCS_TARGETDIR = qt$${MODULE}
|
||||
|
||||
# If Qt was configured with -debug-and-release then build the module the same way
|
||||
# - unless this is a host library
|
||||
|
Loading…
Reference in New Issue
Block a user