2012-12-11 21:08:15 +00:00
|
|
|
#
|
|
|
|
# W A R N I N G
|
|
|
|
# -------------
|
|
|
|
#
|
|
|
|
# This file is not part of the Qt API. It exists purely as an
|
|
|
|
# implementation detail. It may change from version to version
|
|
|
|
# without notice, or even be removed.
|
|
|
|
#
|
|
|
|
# We mean it.
|
|
|
|
#
|
|
|
|
|
2012-11-30 20:07:47 +00:00
|
|
|
!exists($$QMAKE_DOCS): error("Cannot find documentation specification file $$QMAKE_DOCS")
|
|
|
|
|
2015-12-11 11:13:58 +00:00
|
|
|
qtver.name = QT_VERSION
|
|
|
|
qtver.value = $$VERSION
|
|
|
|
isEmpty(qtver.value): qtver.value = $$MODULE_VERSION
|
|
|
|
isEmpty(qtver.value): error("No version for documentation specified.")
|
|
|
|
qtmver.name = QT_VER
|
|
|
|
qtmver.value = $$replace(qtver.value, ^(\\d+\\.\\d+).*$, \\1)
|
|
|
|
qtvertag.name = QT_VERSION_TAG
|
2018-10-19 17:01:37 +00:00
|
|
|
qtvertag.value = $$replace(qtver.value, \\.,)
|
2015-12-11 11:13:58 +00:00
|
|
|
qtdocs.name = QT_INSTALL_DOCS
|
|
|
|
qtdocs.value = $$[QT_INSTALL_DOCS/src]
|
2016-07-01 14:14:31 +00:00
|
|
|
builddir.name = BUILDDIR
|
|
|
|
builddir.value = $$OUT_PWD
|
|
|
|
QT_TOOL_ENV = qtver qtmver qtvertag qtdocs builddir
|
2012-11-30 20:07:47 +00:00
|
|
|
qtPrepareTool(QDOC, qdoc)
|
2015-12-11 11:13:58 +00:00
|
|
|
QT_TOOL_ENV =
|
2016-01-08 16:06:43 +00:00
|
|
|
|
2019-07-23 11:32:31 +00:00
|
|
|
# On Windows, put the includes into a .inc file which QDoc will read, if the project
|
|
|
|
# has too many includes. We do this to overcome a command-line limit on Windows.
|
|
|
|
WIN_INCLUDETEMP=
|
|
|
|
INCLUDE_PATHS=$$INCPATH
|
|
|
|
win32:count(INCLUDE_PATHS, 30, >) {
|
|
|
|
WIN_INCLUDETEMP = $$OUT_PWD/qdocincludepaths.inc
|
|
|
|
WIN_INCLUDETEMP_CONTENT =
|
|
|
|
for (inc, INCLUDE_PATHS): \
|
|
|
|
WIN_INCLUDETEMP_CONTENT += -I$$inc
|
|
|
|
write_file($$absolute_path($$WIN_INCLUDETEMP, $$OUT_PWD), WIN_INCLUDETEMP_CONTENT)|error()
|
|
|
|
}
|
|
|
|
|
|
|
|
isEmpty(WIN_INCLUDETEMP) {
|
|
|
|
QDOC_INCLUDE_PATHS=$(INCPATH)
|
|
|
|
} else {
|
|
|
|
QDOC_INCLUDE_PATHS=@$$shell_quote($$WIN_INCLUDETEMP)
|
|
|
|
}
|
|
|
|
|
2019-11-15 10:29:02 +00:00
|
|
|
macos: QDOC_INCLUDE_PATHS += $$join(QMAKE_DEFAULT_INCDIRS," -I","-I")
|
|
|
|
|
2016-01-08 16:06:43 +00:00
|
|
|
!build_online_docs: qtPrepareTool(QHELPGENERATOR, qhelpgenerator)
|
|
|
|
|
2016-07-01 14:14:31 +00:00
|
|
|
qtPrepareTool(QTATTRIBUTIONSSCANNER, qtattributionsscanner)
|
|
|
|
|
2016-01-08 16:06:43 +00:00
|
|
|
# qtPrepareTool() must be called outside a build pass, as it protects
|
|
|
|
# against concurrent wrapper creation by omitting it during build passes.
|
|
|
|
# However, creating the actual targets is reserved to the build passes.
|
|
|
|
debug_and_release:!build_pass: return()
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2015-12-11 14:01:24 +00:00
|
|
|
QDOC += -outputdir $$shell_quote($$QMAKE_DOCS_OUTPUTDIR)
|
2012-11-30 20:07:47 +00:00
|
|
|
!build_online_docs: \
|
2015-12-11 14:01:24 +00:00
|
|
|
QDOC += -installdir $$shell_quote($$[QT_INSTALL_DOCS])
|
2014-05-23 16:05:05 +00:00
|
|
|
PREP_DOC_INDEXES =
|
2013-07-05 13:42:39 +00:00
|
|
|
DOC_INDEXES =
|
2014-05-21 12:22:31 +00:00
|
|
|
!isEmpty(QTREPOS) {
|
2014-05-23 16:05:05 +00:00
|
|
|
prepare_docs {
|
|
|
|
# This is not for linking, but for providing type information.
|
|
|
|
mps =
|
|
|
|
deps = $$replace(QT, -private$, )
|
|
|
|
deps = $$resolve_depends(deps, "QT.")
|
|
|
|
for (d, deps): \
|
|
|
|
mps += $$dirname(QT.$${d}.libs)
|
|
|
|
mps = $$unique(mps)
|
|
|
|
for (mp, mps): \
|
2015-12-11 14:01:24 +00:00
|
|
|
PREP_DOC_INDEXES += -indexdir $$shell_quote($$mp/doc)
|
2014-05-23 16:05:05 +00:00
|
|
|
}
|
2014-05-21 12:22:31 +00:00
|
|
|
for(qrep, QTREPOS): \
|
2015-12-11 14:01:24 +00:00
|
|
|
DOC_INDEXES += -indexdir $$shell_quote($$qrep/doc)
|
2014-05-21 12:22:31 +00:00
|
|
|
} else {
|
2014-05-23 16:05:05 +00:00
|
|
|
prepare_docs: \
|
2015-12-11 14:01:24 +00:00
|
|
|
PREP_DOC_INDEXES += -indexdir $$shell_quote($$[QT_INSTALL_DOCS/get])
|
|
|
|
DOC_INDEXES += -indexdir $$shell_quote($$[QT_INSTALL_DOCS/get])
|
2014-05-21 12:22:31 +00:00
|
|
|
}
|
2016-07-01 14:14:31 +00:00
|
|
|
|
|
|
|
qtattributionsscanner.target = qtattributionsscanner
|
|
|
|
qtattributionsscanner.commands = $$QTATTRIBUTIONSSCANNER $$shell_quote($$MODULE_BASE_INDIR) \
|
|
|
|
--filter "QDocModule=$$QMAKE_DOCS_TARGET" -o $$shell_quote($$OUT_PWD/codeattributions.qdoc)
|
|
|
|
qtattributionsscanner.CONFIG += phony
|
|
|
|
QMAKE_EXTRA_TARGETS += qtattributionsscanner
|
|
|
|
|
2012-11-30 20:07:47 +00:00
|
|
|
doc_command = $$QDOC $$QMAKE_DOCS
|
|
|
|
prepare_docs {
|
2019-07-23 11:32:31 +00:00
|
|
|
prepare_docs.commands += $$doc_command -prepare $$PREP_DOC_INDEXES -no-link-errors $$QDOC_INCLUDE_PATHS
|
|
|
|
generate_docs.commands += $$doc_command -generate $$DOC_INDEXES $$QDOC_INCLUDE_PATHS
|
2016-07-01 14:14:31 +00:00
|
|
|
prepare_docs.depends += qtattributionsscanner
|
2012-11-30 20:07:47 +00:00
|
|
|
} else {
|
2019-07-23 11:32:31 +00:00
|
|
|
html_docs.commands += $$doc_command $$DOC_INDEXES $(QDOC_INCLUDE_PATHS)
|
2016-07-01 14:14:31 +00:00
|
|
|
html_docs.depends += qtattributionsscanner
|
2012-11-30 20:07:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
!build_online_docs {
|
2015-12-11 14:01:24 +00:00
|
|
|
qch_docs.commands = $$QHELPGENERATOR $$shell_quote($$QMAKE_DOCS_OUTPUTDIR/$${QMAKE_DOCS_TARGET}.qhp) -o $$shell_quote($$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch)
|
2012-11-30 20:07:47 +00:00
|
|
|
|
|
|
|
inst_html_docs.files = $$QMAKE_DOCS_OUTPUTDIR
|
|
|
|
inst_html_docs.path = $$[QT_INSTALL_DOCS]
|
2012-12-04 20:55:06 +00:00
|
|
|
inst_html_docs.CONFIG += no_check_exist directory no_default_install no_build
|
2012-11-30 20:07:47 +00:00
|
|
|
INSTALLS += inst_html_docs
|
|
|
|
|
|
|
|
inst_qch_docs.files = $$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch
|
|
|
|
inst_qch_docs.path = $$[QT_INSTALL_DOCS]
|
2012-12-04 20:55:06 +00:00
|
|
|
inst_qch_docs.CONFIG += no_check_exist no_default_install no_build
|
2012-11-30 20:07:47 +00:00
|
|
|
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
|
|
|
|
}
|