summaryrefslogtreecommitdiff
path: root/doc/doc.pri
blob: 50768cf095b9784b87532ea53a718aef64546c71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#####################################################################
# Qt documentation build
#####################################################################

DOCS_GENERATION_DEFINES =
GENERATOR = $${QT.help.bins}/qhelpgenerator
MODULE = qtdoc

win32:!win32-g++* {
    unixstyle = false
} else :win32-g++*:isEmpty(QMAKE_SH) {
    unixstyle = false
} else {
    unixstyle = true
}

$$unixstyle {
    SET =
    SEP =
} else {
    SET = set
    SEP = &&
}

# The module names correspond to the names of files in qtbase/mkspecs/modules
# that take the form qt_<module>.pri. This is why we see clucene, not qttools,
# and systeminfo, not systems.

MODULES = activeqt \
          core \ # dbus gui network opengl openvg sql testlib uilib uitools xml
          declarative \
          doc \
          clucene \ # help designer
          location \
          multimedia \
          phonon \
          publishsubscribe \
          3d \
          script \ # scripttools
          sensors \
          serviceframework \
          systeminfo \
          svg \
          webkit \
          webkit-examples-and-demos \
          xmlpatterns \
          contacts \
          organizer \
          versit \
          bluetooth

# Compile a list of location definitions for each of the modules and a list of
# qdocconf files to include.

LOCATIONS =
INCLUDES =
for(module, MODULES) {

    INCLUDES += $$SET

    # Take the module name and convert it to the name of the variable that
    # contains the sources path, which takes the form, QT.<module name>.sources.

    module_name = $$upper($$module)
    module_name = $$replace(module_name, "-", "_")
    module_value = $$eval(QT.$$replace(module, "-", "_").sources)
    !isEmpty(module_value) {
        LOCATIONS += $$SET
        LOCATIONS += QT_$${module_name}_SOURCES=$$module_value$$SEP

        INCLUDES += QT_$${module_name}_QDOCCONF=modules/qt$${module}.qdocconf$$SEP
        debug : message($$module : $$module_value)
    } else {
        INCLUDES += QT_$${module_name}_QDOCCONF=modules/missing.qdocconf$$SEP
        debug : message($$module not found.)
    }
}

# Output the locations and includes as build messages. This helps the user to
# see which modules have been installed and diagnose any problems.

message($$LOCATIONS)
message($$INCLUDES)

# Input files in the source tree
ONLINE_QDOCCONF = $${QT.doc.sources}/doc/config/qt-build-docs-online.qdocconf
ONLINE_QDOCCONF = $$replace(ONLINE_QDOCCONF, "/", $$QMAKE_DIR_SEP)

DITA_QDOCCONF = $${QT.doc.sources}/doc/config/qt-ditaxml.qdocconf
DITA_QDOCCONF = $$replace(DITA_QDOCCONF, "/", $$QMAKE_DIR_SEP)

OFFLINE_QDOCCONF = $${QT.doc.sources}/doc/config/qt-build-docs.qdocconf
OFFLINE_QDOCCONF = $$replace(OFFLINE_QDOCCONF, "/", $$QMAKE_DIR_SEP)

MODULE_ONLINE_QDOCCONF = $${QT.doc.sources}/doc/config/$${MODULE}-online.qdocconf
MODULE_ONLINE_QDOCCONF = $$replace(ONLINE_QDOCCONF, "/", $$QMAKE_DIR_SEP)

MODULE_OFFLINE_QDOCCONF = $${QT.doc.sources}/doc/config/$${MODULE}.qdocconf
MODULE_OFFLINE_QDOCCONF = $$replace(OFFLINE_QDOCCONF, "/", $$QMAKE_DIR_SEP)

# Output files in the build tree
QHP_FILE = html/qt.qhp
QHP_FILE = $$replace(QHP_FILE, "/", $$QMAKE_DIR_SEP)
QCH_FILE = qch/qt.qch
QCH_FILE = $$replace(QCH_FILE, "/", $$QMAKE_DIR_SEP)

INDEX_FILE = html/qt.index
INDEX_FILE = $$replace(INDEX_FILE, "/", $$QMAKE_DIR_SEP)
INDEX_DEST = $$INDEX_DESTDIR/qt.index
INDEX_DEST = $$replace(INDEX_DEST, "/", $$QMAKE_DIR_SEP)

MODULE_QHP_FILE = html/$${MODULE}.qhp
MODULE_QHP_FILE = $$replace(QHP_FILE, "/", $$QMAKE_DIR_SEP)
MODULE_QCH_FILE = qch/$${MODULE}.qch
MODULE_QCH_FILE = $$replace(QCH_FILE, "/", $$QMAKE_DIR_SEP)

MODULE_INDEX_FILE = html/$${MODULE}.index
MODULE_INDEX_FILE = $$replace(INDEX_FILE, "/", $$QMAKE_DIR_SEP)
MODULE_INDEX_DEST = $$INDEX_DESTDIR/$${MODULE}.index
MODULE_INDEX_DEST = $$replace(INDEX_DEST, "/", $$QMAKE_DIR_SEP)

$$unixstyle {
    QDOC = $$LOCATIONS $$INCLUDES MODULE_SOURCE_TREE=$${QT.doc.sources} MODULE_BUILD_TREE=$$MODULE_BUILD_DIR $$QT.core.bins/qdoc $$DOCS_GENERATION_DEFINES
} else {
    QDOC = $$LOCATIONS $$INCLUDES set MODULE_SOURCE_TREE=$${QT.doc.sources} && set MODULE_BUILD_TREE=$$MODULE_BUILD_DIR && $$QT.core.bins/qdoc.exe $$DOCS_GENERATION_DEFINES
    QDOC = $$replace(QDOC, "/", $$QMAKE_DIR_SEP)
}

# Build rules:

online_docs.commands = ($$QDOC $$ONLINE_QDOCCONF)

dita_docs.commands = ($$QDOC $$DITA_QDOCCONF)

qch_docs.commands = ($$QDOC $$OFFLINE_QDOCCONF && \
                     $$GENERATOR -platform minimal $$QHP_FILE -o $$QCH_FILE)

docs.commands = ($$QDOC $$OFFLINE_QDOCCONF && \
                 $$GENERATOR -platform minimal $$QHP_FILE -o $$QCH_FILE && \
                 $$QDOC $$ONLINE_QDOCCONF)

# Install rules

htmldocs.files = html
htmldocs.path = $$[QT_INSTALL_DOCS]
htmldocs.CONFIG += no_check_exist directory

qchdocs.files= qch
qchdocs.path = $$[QT_INSTALL_DOCS]
qchdocs.CONFIG += no_check_exist directory

docimages.files = src/images
docimages.path = $$[QT_INSTALL_DOCS]/src

QMAKE_EXTRA_TARGETS += online_docs qch_docs docs dita_docs
INSTALLS += htmldocs qchdocs docimages