410.1.9
by Matthew Fuller
Bust out the manual building bits. |
1 |
#
|
2 |
# Handle stuff related to building the manual in various ways
|
|
3 |
#
|
|
4 |
||
5 |
||
470.1.1
by Matthew Fuller
Break out the "find/figure out asciidoc[tor]" bits from the "build |
6 |
# Lookup the asciidoc[tor] bits
|
7 |
include(find_asciidoc_bits) |
|
413.1.14
by Matthew Fuller
Also check for `asciidoctor` and try figuring out its version. |
8 |
|
9 |
||
10 |
||
410.1.9
by Matthew Fuller
Bust out the manual building bits. |
11 |
#
|
12 |
# Setup some vars for the various steps in the process
|
|
13 |
#
|
|
14 |
||
413.1.22
by Matthew Fuller
Tweak and expand some comments. Switch to using CMAKE_BINARY_DIR |
15 |
# The original source.
|
584.1.1
by Matthew Fuller
Better var name, and slightly less misleading comments. |
16 |
set(ADOC_SRC ${MANSRCDIR}/ctwm.1.adoc) |
410.1.9
by Matthew Fuller
Bust out the manual building bits. |
17 |
|
413.1.22
by Matthew Fuller
Tweak and expand some comments. Switch to using CMAKE_BINARY_DIR |
18 |
# Where we build stuff. Because we need to process the ADOC_SRC to
|
19 |
# replace build paths etc, we need to dump it somewhere. We could just
|
|
20 |
# leave it right in the build dir root, but is cleaner.
|
|
21 |
set(MAN_TMPDIR ${CMAKE_BINARY_DIR}/mantmp) |
|
410.1.9
by Matthew Fuller
Bust out the manual building bits. |
22 |
|
23 |
# Where we copy the source to during rewrites, and then do the actual
|
|
24 |
# build from.
|
|
413.1.1
by Matthew Fuller
Rename MANPAGE_TMPDIR to MAN_TMPDIR since it can get used for various |
25 |
set(ADOC_TMPSRC ${MAN_TMPDIR}/ctwm.1.adoc) |
410.1.9
by Matthew Fuller
Bust out the manual building bits. |
26 |
|
27 |
# Where the end products wind up
|
|
413.1.22
by Matthew Fuller
Tweak and expand some comments. Switch to using CMAKE_BINARY_DIR |
28 |
set(MANPAGE ${CMAKE_BINARY_DIR}/ctwm.1) |
29 |
set(MANHTML ${CMAKE_BINARY_DIR}/ctwm.1.html) |
|
493.1.4
by Matthew Fuller
Hook up routines for building PDF manual output. |
30 |
set(MANDBXML ${CMAKE_BINARY_DIR}/ctwm.1.xml) |
31 |
set(MANPDF ${CMAKE_BINARY_DIR}/ctwm.1.pdf) |
|
410.1.9
by Matthew Fuller
Bust out the manual building bits. |
32 |
|
410.1.21
by Matthew Fuller
Move the transformation of the asciidoc source into |
33 |
# How we rewrite vars in the manual. I decided not to use
|
34 |
# configure_file() for this, as it opens up too many chances for
|
|
35 |
# something to accidentally get sub'd, since we assume people will write
|
|
36 |
# pretty freeform in the manual.
|
|
685.1.10
by Matthew Fuller
We're requiring >3.1 now, so this policy is enabled and we don't need |
37 |
set(MANSED_CMD sed -e \"s,@ETCDIR@,${ETCDIR},\" |
38 |
-e \"s,@ctwm_version_str@,`head -1 ${CMAKE_SOURCE_DIR}/VERSION`,\") |
|
410.1.21
by Matthew Fuller
Move the transformation of the asciidoc source into |
39 |
|
413.1.9
by Matthew Fuller
Switch to defining the _PRESRC paths and using EXISTS checks, rather |
40 |
# Pregen'd doc file paths we might have, in case we can't build them
|
41 |
# ourselves.
|
|
546.1.6
by Matthew Fuller
Correct paths to gen'd manual. |
42 |
set(MAN_PRESRC ${GENSRCDIR}/ctwm.1)
|
43 |
set(HTML_PRESRC ${GENSRCDIR}/ctwm.1.html)
|
|
413.1.9
by Matthew Fuller
Switch to defining the _PRESRC paths and using EXISTS checks, rather |
44 |
|
45 |
||
410.1.9
by Matthew Fuller
Bust out the manual building bits. |
46 |
|
47 |
||
410.1.25
by Matthew Fuller
Whitespace/comments tweaks. |
48 |
|
413.1.12
by Matthew Fuller
Mess a bit with whitespace/comments, and remove unused var, now that |
49 |
# Figure what we can build
|
50 |
#
|
|
51 |
# These are both boolean "We can build this type of output" flags, and |
|
52 |
# enums for later code for "What method we use to build this type of |
|
53 |
# output".
|
|
413.1.15
by Matthew Fuller
Extend logic for setting MANUAL_BUILD_* so now we can set the |
54 |
|
607
by Matthew Fuller
Figure out whether we can build docbook XML before we potentially try |
55 |
# We use the DocBook XML output for PDF (if manually requested), and
|
56 |
# _can_ use it in very special cases for manpages. So find out first if
|
|
57 |
# we can even build it.
|
|
58 |
set(MANUAL_BUILD_DBXML) |
|
59 |
if(ASCIIDOCTOR AND ASCIIDOCTOR_CAN_DBXML) |
|
60 |
set(MANUAL_BUILD_DBXML asciidoctor) |
|
61 |
elseif(ASCIIDOC AND ASCIIDOC_CAN_DBXML) |
|
62 |
set(MANUAL_BUILD_DBXML asciidoc) |
|
63 |
endif() |
|
64 |
||
413.1.15
by Matthew Fuller
Extend logic for setting MANUAL_BUILD_* so now we can set the |
65 |
# If we have asciidoctor, use it to build the HTML. Else, we could use
|
66 |
# asciidoc, but leave it disabled because it's very slow.
|
|
67 |
set(MANUAL_BUILD_HTML) |
|
68 |
if(ASCIIDOCTOR AND ASCIIDOCTOR_CAN_HTML) |
|
69 |
set(MANUAL_BUILD_HTML asciidoctor) |
|
70 |
elseif(ASCIIDOC) |
|
493.1.19
by Matthew Fuller
Reshuffle things a bit so that the 'man-html' target will still build |
71 |
set(MANUAL_BUILD_HTML asciidoc) |
72 |
if(NOT ENABLE_ASCIIDOC_HTML) |
|
73 |
set(NOAUTO_HTML 1) |
|
470.1.6
by Matthew Fuller
Allow an undocumented override to force enabling the asciidoc-built |
74 |
message(STATUS "Not enabling HTML manual build; asciidoc is slow.") |
75 |
endif() |
|
413.1.15
by Matthew Fuller
Extend logic for setting MANUAL_BUILD_* so now we can set the |
76 |
endif() |
77 |
||
78 |
# For the manpage output, asciidoctor has to be of a certain version. If
|
|
413.1.24
by Matthew Fuller
Slightly improve wording. |
79 |
# it's not there or not high enough version, we fall back to asciidoc/a2x
|
413.1.15
by Matthew Fuller
Extend logic for setting MANUAL_BUILD_* so now we can set the |
80 |
# (which is very slow at this too, but we need to build a manpage, so eat
|
607
by Matthew Fuller
Figure out whether we can build docbook XML before we potentially try |
81 |
# the expense). And it's possible to go via the DocBook XML output, but
|
82 |
# it takes very odd cases to wind up there.
|
|
413.1.6
by Matthew Fuller
Set flags for the tools to build individual pieces. |
83 |
set(MANUAL_BUILD_MANPAGE) |
413.1.15
by Matthew Fuller
Extend logic for setting MANUAL_BUILD_* so now we can set the |
84 |
if(ASCIIDOCTOR AND ASCIIDOCTOR_CAN_MAN) |
85 |
set(MANUAL_BUILD_MANPAGE asciidoctor) |
|
470.1.7
by Matthew Fuller
Probably better reversed like this to be sure we can't get an |
86 |
elseif(A2X AND ASCIIDOC_CAN_MAN) |
413.1.6
by Matthew Fuller
Set flags for the tools to build individual pieces. |
87 |
set(MANUAL_BUILD_MANPAGE a2x) |
607
by Matthew Fuller
Figure out whether we can build docbook XML before we potentially try |
88 |
elseif(XMLTO AND XMLTO_CAN_STUFF AND MANUAL_BUILD_DBXML) |
493.1.12
by Matthew Fuller
Try (and fail) to improve xmlto man output, and leave a comment about |
89 |
# Should probably never happen in reality
|
493.1.11
by Matthew Fuller
Add experimental support for using xmlto to output manpage. |
90 |
set(MANUAL_BUILD_MANPAGE xmlto) |
413.1.15
by Matthew Fuller
Extend logic for setting MANUAL_BUILD_* so now we can set the |
91 |
endif() |
413.1.5
by Matthew Fuller
Start making a little separation between the factual "found these |
92 |
|
493.1.4
by Matthew Fuller
Hook up routines for building PDF manual output. |
93 |
# PDF output is not hooked into the build process by default, but is made
|
94 |
# available by an extra target.
|
|
95 |
set(MANUAL_BUILD_PDF) |
|
96 |
if(DBLATEX AND DBLATEX_CAN_PDF AND MANUAL_BUILD_DBXML) |
|
97 |
set(MANUAL_BUILD_PDF dblatex) |
|
98 |
endif() |
|
99 |
||
413.1.5
by Matthew Fuller
Start making a little separation between the factual "found these |
100 |
|
546.1.9
by Matthew Fuller
Add a FORCE_PREGEN_FILES check in the cmake setup so that we can force |
101 |
# Override: allow forcing use of pregen'd files.
|
102 |
if(FORCE_PREGEN_FILES) |
|
103 |
set(MANUAL_BUILD_HTML) |
|
104 |
set(MANUAL_BUILD_MANPAGE) |
|
105 |
set(MANUAL_BUILD_DBXML) |
|
106 |
endif() |
|
107 |
||
108 |
||
493.1.18
by Matthew Fuller
Switch around to unconditionally setting up man tmp/rewriting stuff. |
109 |
# If we can build stuff, prepare bits for it. Technically unnecessary if
|
110 |
# we're not building stuff, but doesn't do anything bad to define it in
|
|
111 |
# those cases, and it's easier than listing every MANUAL_BUILD_* in the
|
|
112 |
# conditions.
|
|
113 |
set(SETUP_MAN_REWRITE 1) |
|
114 |
if(SETUP_MAN_REWRITE) |
|
410.1.9
by Matthew Fuller
Bust out the manual building bits. |
115 |
# Setup a temp dir under the build for our processing
|
413.1.1
by Matthew Fuller
Rename MANPAGE_TMPDIR to MAN_TMPDIR since it can get used for various |
116 |
file(MAKE_DIRECTORY ${MAN_TMPDIR}) |
410.1.9
by Matthew Fuller
Bust out the manual building bits. |
117 |
|
118 |
# We hop through a temporary file to process in definitions for e.g.
|
|
410.1.21
by Matthew Fuller
Move the transformation of the asciidoc source into |
119 |
# $ETCDIR.
|
120 |
add_custom_command(OUTPUT ${ADOC_TMPSRC} |
|
516.1.10
by Matthew Fuller
Redo how we get the version number into the manual to read from |
121 |
DEPENDS ${ADOC_SRC} ${CMAKE_SOURCE_DIR}/VERSION |
410.1.21
by Matthew Fuller
Move the transformation of the asciidoc source into |
122 |
COMMAND ${MANSED_CMD} < ${ADOC_SRC} > ${ADOC_TMPSRC} |
413.1.13
by Matthew Fuller
Simplify these comments on the targets so they're more user-friendly. |
123 |
COMMENT "Processing ctwm.1.adoc -> mantmp/ctwm.1.adoc" |
410.1.21
by Matthew Fuller
Move the transformation of the asciidoc source into |
124 |
)
|
416
by Matthew Fuller
Work around a cmake deficiency that can cause troubles with |
125 |
|
448
by Matthew Fuller
Fixup dependancies so the manual notices when it needs to be rebuilt, |
126 |
# We can't actually make other targets depend just on that generated
|
416
by Matthew Fuller
Work around a cmake deficiency that can cause troubles with |
127 |
# source file, because cmake will try to multi-build it in parallel.
|
128 |
# To work around, we add a do-nothing custom target that depends on
|
|
448
by Matthew Fuller
Fixup dependancies so the manual notices when it needs to be rebuilt, |
129 |
# $ADOC_TMPSRC, that uses of it depend on.
|
416
by Matthew Fuller
Work around a cmake deficiency that can cause troubles with |
130 |
#
|
131 |
# x-ref http://public.kitware.com/Bug/view.php?id=12311
|
|
448
by Matthew Fuller
Fixup dependancies so the manual notices when it needs to be rebuilt, |
132 |
#
|
133 |
# Note, however, that this _doesn't_ transmit the dependancy on
|
|
134 |
# ${ADOC_TMPDIR} through; it serves only to serialize the build so it
|
|
135 |
# doesn't try to happen twice at once. So we still need to include
|
|
136 |
# ${ADOC_TMPSRC} in the DEPENDS for the targets building off it, or
|
|
137 |
# they don't notice when they go out of date.
|
|
416
by Matthew Fuller
Work around a cmake deficiency that can cause troubles with |
138 |
add_custom_target(mk_adoc_tmpsrc DEPENDS ${ADOC_TMPSRC}) |
493.1.18
by Matthew Fuller
Switch around to unconditionally setting up man tmp/rewriting stuff. |
139 |
endif(SETUP_MAN_REWRITE) |
413.1.10
by Matthew Fuller
Use MANUAL_BUILD_MANPAGE semantic var to define the blocks for doing |
140 |
|
141 |
||
413.1.12
by Matthew Fuller
Mess a bit with whitespace/comments, and remove unused var, now that |
142 |
|
143 |
||
413.1.10
by Matthew Fuller
Use MANUAL_BUILD_MANPAGE semantic var to define the blocks for doing |
144 |
#
|
145 |
# Building the manpage variant
|
|
146 |
#
|
|
147 |
set(HAS_MAN 0) |
|
148 |
if(MANUAL_BUILD_MANPAGE) |
|
149 |
# Got the tool to build it
|
|
150 |
message(STATUS "Building manpage with ${MANUAL_BUILD_MANPAGE}.") |
|
151 |
set(HAS_MAN 1) |
|
410.1.9
by Matthew Fuller
Bust out the manual building bits. |
152 |
|
413.1.16
by Matthew Fuller
Make the manpage generation know what to do with asciidoctor. |
153 |
if(${MANUAL_BUILD_MANPAGE} STREQUAL "asciidoctor") |
154 |
# We don't need the hoops for a2x here, since asciidoctor lets us
|
|
155 |
# specify the output directly.
|
|
470.1.11
by Matthew Fuller
Compress whitespace. |
156 |
asciidoctor_mk_manpage(${MANPAGE} ${ADOC_TMPSRC} DEPENDS mk_adoc_tmpsrc) |
413.1.16
by Matthew Fuller
Make the manpage generation know what to do with asciidoctor. |
157 |
elseif(${MANUAL_BUILD_MANPAGE} STREQUAL "a2x") |
470.1.10
by Matthew Fuller
Write a generalized asciidoc_mk_manpage() that should allow easy |
158 |
# a2x has to jump through some stupid hoops
|
470.1.14
by Matthew Fuller
Rename this func to closer match what's actually called. |
159 |
a2x_mk_manpage(${MANPAGE} ${ADOC_TMPSRC} DEPENDS mk_adoc_tmpsrc) |
493.1.11
by Matthew Fuller
Add experimental support for using xmlto to output manpage. |
160 |
elseif(${MANUAL_BUILD_MANPAGE} STREQUAL "xmlto") |
161 |
# xmlto does its own hoops too
|
|
162 |
xmlto_mk_manpage(${MANPAGE} ${MANDBXML}) |
|
413.1.16
by Matthew Fuller
Make the manpage generation know what to do with asciidoctor. |
163 |
else() |
164 |
message(FATAL_ERROR "I don't know what to do with that manpage " |
|
165 |
"building type!") |
|
166 |
endif() |
|
413.1.10
by Matthew Fuller
Use MANUAL_BUILD_MANPAGE semantic var to define the blocks for doing |
167 |
elseif(EXISTS ${MAN_PRESRC}) |
168 |
# Can't build it ourselves, but we've got a prebuilt version.
|
|
169 |
message(STATUS "Can't build manpage, using prebuilt version.") |
|
170 |
set(HAS_MAN 1) |
|
171 |
||
172 |
# We still have to do the substitutions like above, but we're doing
|
|
173 |
# it on the built version now, rather than the source.
|
|
174 |
add_custom_command(OUTPUT ${MANPAGE} |
|
516.1.10
by Matthew Fuller
Redo how we get the version number into the manual to read from |
175 |
DEPENDS ${MAN_PRESRC} ${CMAKE_SOURCE_DIR}/VERSION |
413.1.10
by Matthew Fuller
Use MANUAL_BUILD_MANPAGE semantic var to define the blocks for doing |
176 |
COMMAND ${MANSED_CMD} < ${MAN_PRESRC} > ${MANPAGE} |
413.1.13
by Matthew Fuller
Simplify these comments on the targets so they're more user-friendly. |
177 |
COMMENT "Processing prebuilt manpage -> ctwm.1" |
413.1.10
by Matthew Fuller
Use MANUAL_BUILD_MANPAGE semantic var to define the blocks for doing |
178 |
)
|
410.1.9
by Matthew Fuller
Bust out the manual building bits. |
179 |
else() |
413.1.10
by Matthew Fuller
Use MANUAL_BUILD_MANPAGE semantic var to define the blocks for doing |
180 |
# Can't build it, no prebuilt. Not quite fatal, but very bad.
|
181 |
message(WARNING "Can't build manpage, and no prebuilt version " |
|
182 |
"available. You won't get one.") |
|
183 |
endif(MANUAL_BUILD_MANPAGE) |
|
184 |
||
185 |
||
186 |
# Assuming we have it, compress manpage (conditionally). We could add
|
|
187 |
# more magic to allow different automatic compression, but that's
|
|
188 |
# probably way more involved than we need to bother with. Most systems
|
|
189 |
# use gzip, and for the few that don't, the packagers can use
|
|
190 |
# NOMANCOMPRESS and handle it out of band.
|
|
191 |
if(HAS_MAN) |
|
192 |
if(NOT NOMANCOMPRESS) |
|
193 |
find_program(GZIP_CMD gzip) |
|
194 |
add_custom_command(OUTPUT "${MANPAGE}.gz" |
|
195 |
DEPENDS ${MANPAGE} |
|
196 |
COMMAND ${GZIP_CMD} -nc ${MANPAGE} > ${MANPAGE}.gz |
|
413.1.13
by Matthew Fuller
Simplify these comments on the targets so they're more user-friendly. |
197 |
COMMENT "Compressing ctwm.1.gz" |
413.1.10
by Matthew Fuller
Use MANUAL_BUILD_MANPAGE semantic var to define the blocks for doing |
198 |
)
|
199 |
add_custom_target(man ALL DEPENDS "${MANPAGE}.gz") |
|
200 |
set(INSTMAN "${MANPAGE}.gz") |
|
410.1.9
by Matthew Fuller
Bust out the manual building bits. |
201 |
else() |
413.1.10
by Matthew Fuller
Use MANUAL_BUILD_MANPAGE semantic var to define the blocks for doing |
202 |
add_custom_target(man ALL DEPENDS ${MANPAGE}) |
203 |
set(INSTMAN ${MANPAGE}) |
|
204 |
endif(NOT NOMANCOMPRESS) |
|
205 |
endif(HAS_MAN) |
|
206 |
||
207 |
||
208 |
||
413.1.12
by Matthew Fuller
Mess a bit with whitespace/comments, and remove unused var, now that |
209 |
|
413.1.11
by Matthew Fuller
Now rewrite the HTML-handling block similarly to the manpage one. |
210 |
#
|
211 |
# Do the HTML manual
|
|
212 |
#
|
|
213 |
set(HAS_HTML 0) |
|
584.1.6
by Matthew Fuller
Rearrange some of the conditionals around HTML manual building, so |
214 |
if(MANUAL_BUILD_HTML AND NOAUTO_HTML) |
215 |
message(STATUS "Not autobuilding HTML manual with ${MANUAL_BUILD_HTML}.") |
|
216 |
endif() |
|
605.1.7
by Matthew Fuller
Drop a comment to explain the slight oddity in control flow. |
217 |
# Separate if() rather than an elseif() so that the above case can still
|
218 |
# fall into the elseif(EXISTS ${HTML_PRESRC}) below and use the pregen'd
|
|
219 |
# version.
|
|
584.1.6
by Matthew Fuller
Rearrange some of the conditionals around HTML manual building, so |
220 |
if(MANUAL_BUILD_HTML AND NOT NOAUTO_HTML) |
413.1.11
by Matthew Fuller
Now rewrite the HTML-handling block similarly to the manpage one. |
221 |
# Got the tool to build it
|
584.1.6
by Matthew Fuller
Rearrange some of the conditionals around HTML manual building, so |
222 |
message(STATUS "Building HTML manual with ${MANUAL_BUILD_HTML}.") |
413.1.11
by Matthew Fuller
Now rewrite the HTML-handling block similarly to the manpage one. |
223 |
set(HAS_HTML 1) |
224 |
||
413.1.19
by Matthew Fuller
Whoops, check the right var here. That was dumb. |
225 |
if(${MANUAL_BUILD_HTML} STREQUAL "asciidoctor") |
470.1.12
by Matthew Fuller
Add and use funcs to generate HTML output targets too. |
226 |
asciidoctor_mk_html(${MANHTML} ${ADOC_TMPSRC} DEPENDS mk_adoc_tmpsrc) |
413.1.19
by Matthew Fuller
Whoops, check the right var here. That was dumb. |
227 |
elseif(${MANUAL_BUILD_HTML} STREQUAL "asciidoc") |
470.1.12
by Matthew Fuller
Add and use funcs to generate HTML output targets too. |
228 |
asciidoc_mk_html(${MANHTML} ${ADOC_TMPSRC} DEPENDS mk_adoc_tmpsrc) |
413.1.17
by Matthew Fuller
Implement the HTML manual building for asciidoctor. |
229 |
else() |
230 |
message(FATAL_ERROR "I don't know what to do with that HTML manual " |
|
231 |
"building type!") |
|
232 |
endif() |
|
413.1.11
by Matthew Fuller
Now rewrite the HTML-handling block similarly to the manpage one. |
233 |
elseif(EXISTS ${HTML_PRESRC}) |
234 |
# Can't build it ourselves, but we've got a prebuilt version.
|
|
413.1.26
by Matthew Fuller
Dunno where we got this extra space.o |
235 |
message(STATUS "Can't build HTML manual, using prebuilt version.") |
413.1.11
by Matthew Fuller
Now rewrite the HTML-handling block similarly to the manpage one. |
236 |
set(HAS_HTML 1) |
584.1.6
by Matthew Fuller
Rearrange some of the conditionals around HTML manual building, so |
237 |
set(NOAUTO_HTML) # Clear so ALL target get set below |
413.1.11
by Matthew Fuller
Now rewrite the HTML-handling block similarly to the manpage one. |
238 |
|
239 |
# As with the manpage above, we need to do the processing on the
|
|
240 |
# generated version for build options.
|
|
410.1.20
by Matthew Fuller
Now that we're defining the paths early on enough, we can move all |
241 |
add_custom_command(OUTPUT ${MANHTML} |
516.1.10
by Matthew Fuller
Redo how we get the version number into the manual to read from |
242 |
DEPENDS ${HTML_PRESRC} ${CMAKE_SOURCE_DIR}/VERSION |
410.1.20
by Matthew Fuller
Now that we're defining the paths early on enough, we can move all |
243 |
COMMAND ${MANSED_CMD} < ${HTML_PRESRC} > ${MANHTML} |
413.1.13
by Matthew Fuller
Simplify these comments on the targets so they're more user-friendly. |
244 |
COMMENT "Processing prebuilt manual -> ctwm.1.html" |
410.1.20
by Matthew Fuller
Now that we're defining the paths early on enough, we can move all |
245 |
)
|
413.1.11
by Matthew Fuller
Now rewrite the HTML-handling block similarly to the manpage one. |
246 |
|
247 |
else() |
|
248 |
# Can't build it, no prebuilt.
|
|
249 |
# Left as STATUS, since this is "normal" for now.
|
|
250 |
message(STATUS "Can't build HTML manual, and no prebuilt version " |
|
251 |
"available.") |
|
584.1.6
by Matthew Fuller
Rearrange some of the conditionals around HTML manual building, so |
252 |
endif() # Variants of building HTML manual |
410.1.25
by Matthew Fuller
Whitespace/comments tweaks. |
253 |
|
254 |
||
410.1.23
by Matthew Fuller
Add comment. |
255 |
# If we have (or are building) the HTML, add an easy target for it, and
|
256 |
# define a var for the install process to notice.
|
|
410.1.20
by Matthew Fuller
Now that we're defining the paths early on enough, we can move all |
257 |
if(HAS_HTML) |
493.1.19
by Matthew Fuller
Reshuffle things a bit so that the 'man-html' target will still build |
258 |
if(NOAUTO_HTML) |
259 |
add_custom_target(man-html DEPENDS ${MANHTML}) |
|
260 |
else() |
|
261 |
add_custom_target(man-html ALL DEPENDS ${MANHTML}) |
|
262 |
set(INSTHTML ${MANHTML}) |
|
263 |
endif(NOAUTO_HTML) |
|
410.1.20
by Matthew Fuller
Now that we're defining the paths early on enough, we can move all |
264 |
endif(HAS_HTML) |
493.1.4
by Matthew Fuller
Hook up routines for building PDF manual output. |
265 |
|
266 |
||
267 |
||
268 |
||
269 |
#
|
|
270 |
# Building DocBook XML
|
|
271 |
#
|
|
272 |
set(HAS_DBXML 0) |
|
273 |
if(MANUAL_BUILD_DBXML) |
|
274 |
# Got the tool to build it
|
|
275 |
#message(STATUS "Building DocBook XML with ${MANUAL_BUILD_DBXML}.")
|
|
276 |
set(HAS_DBXML 1) |
|
277 |
||
278 |
if(${MANUAL_BUILD_DBXML} STREQUAL "asciidoctor") |
|
279 |
# We don't need the hoops for a2x here, since asciidoctor lets us
|
|
280 |
# specify the output directly.
|
|
493.1.16
by Matthew Fuller
Switch around so we stick with article doctype for DocBook output |
281 |
asciidoctor_mk_docbook(${MANDBXML} ${ADOC_TMPSRC} DEPENDS mk_adoc_tmpsrc) |
493.1.4
by Matthew Fuller
Hook up routines for building PDF manual output. |
282 |
elseif(${MANUAL_BUILD_DBXML} STREQUAL "asciidoc") |
283 |
# a2x has to jump through some stupid hoops
|
|
493.1.16
by Matthew Fuller
Switch around so we stick with article doctype for DocBook output |
284 |
asciidoc_mk_docbook(${MANDBXML} ${ADOC_TMPSRC} DEPENDS mk_adoc_tmpsrc) |
493.1.4
by Matthew Fuller
Hook up routines for building PDF manual output. |
285 |
else() |
286 |
message(FATAL_ERROR "I don't know what to do with that DocBook " |
|
287 |
"building type!") |
|
288 |
endif() |
|
289 |
endif(MANUAL_BUILD_DBXML) |
|
290 |
||
291 |
||
292 |
||
293 |
||
294 |
#
|
|
295 |
# And the PDF output
|
|
296 |
#
|
|
297 |
set(HAS_PDF 0) |
|
298 |
if(MANUAL_BUILD_PDF) |
|
299 |
# Got the tool to build it
|
|
300 |
#message(STATUS "Building PDF with ${MANUAL_BUILD_PDF}.")
|
|
301 |
set(HAS_PDF 1) |
|
302 |
||
303 |
if(${MANUAL_BUILD_PDF} STREQUAL "dblatex") |
|
304 |
dblatex_mk_pdf(${MANPDF} ${MANDBXML}) |
|
305 |
else() |
|
306 |
message(FATAL_ERROR "I don't know what to do with that PDF " |
|
307 |
"building type!") |
|
308 |
endif() |
|
309 |
endif(MANUAL_BUILD_PDF) |
|
310 |
||
311 |
if(HAS_PDF) |
|
312 |
add_custom_target(man-pdf DEPENDS ${MANPDF}) |
|
313 |
endif(HAS_PDF) |
|
493.1.6
by Matthew Fuller
Add a "man-all" synthetic target to build all the manual output |
314 |
|
315 |
||
316 |
||
317 |
||
318 |
#
|
|
319 |
# Handy target
|
|
320 |
#
|
|
321 |
set(MAN_TYPES) |
|
322 |
if(HAS_MAN) |
|
323 |
list(APPEND MAN_TYPES man) |
|
324 |
endif() |
|
325 |
if(HAS_HTML) |
|
326 |
list(APPEND MAN_TYPES man-html) |
|
327 |
endif() |
|
328 |
if(HAS_PDF) |
|
329 |
list(APPEND MAN_TYPES man-pdf) |
|
330 |
endif() |
|
331 |
add_custom_target(man-all DEPENDS ${MAN_TYPES}) |