CMake: Fix package requirements for building docs
[metze/wireshark/wip.git] / docbook / CMakeLists.txt
1 # CMakeLists.txt
2 #
3 # Wireshark - Network traffic analyzer
4 # By Gerald Combs <gerald@wireshark.org>
5 # Copyright 1998 Gerald Combs
6 #
7 # SPDX-License-Identifier: GPL-2.0+
8 #
9
10 find_package( LYNX )
11 if(ENABLE_HTML_GUIDES OR ENABLE_PDF_GUIDES OR ENABLE_CHM_GUIDES)
12         find_package( ASCIIDOC REQUIRED )
13         find_package( XSLTPROC REQUIRED )
14 else()
15         # This is an optional add of the packages
16         find_package( ASCIIDOC )
17         find_package( XSLTPROC )
18 endif()
19
20 if(ENABLE_CHM_GUIDES)
21         find_package( HTMLHelp REQUIRED )
22         if(HTML_HELP_COMPILER)
23                 # We do not need the HTML Help headers and library, just the
24                 # compiler. To avoid confusion, report the package as found.
25                 # https://gitlab.kitware.com/cmake/cmake/issues/15886
26                 set(HTMLHelp_FOUND 1)
27         else()
28                 message(FATAL_ERROR "HTML Help Compiler is not installed (required for ENABLE_CHM_GUIDES)")
29         endif()
30 endif()
31
32 if(WIN32)
33         macro( HHP2CHM _hhpsource )
34                 get_filename_component( _source_base_name ${_hhpsource} NAME_WE )
35
36                 add_custom_command(
37                         OUTPUT ${_output_chm}
38                         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
39                         # The number and order of arguments MUST match hhc.cmake.
40                         COMMAND ${CMAKE_COMMAND} -P
41                                 ${CMAKE_SOURCE_DIR}/cmake/modules/hhc.cmake
42                                         "${HTML_HELP_COMPILER}"
43                                         ${_hhpsource}
44                         DEPENDS
45                                 ${_hhpsource}
46                 )
47         endmacro()
48 else()
49         macro( HHP2CHM _hhpsource )
50         # Dummy.
51         endmacro()
52 endif()
53
54 set(COMMON_FILES
55         common_src/GPL_appendix.asciidoc
56 )
57
58 set(COMMON_GRAPHICS
59         common_graphics/note.svg
60         common_graphics/tip.svg
61         common_graphics/warning.svg
62 )
63
64 set(WSUG_TOOLS_HELP_COMMANDS
65         capinfos
66         dumpcap
67         editcap
68         mergecap
69         rawshark
70         reordercap
71         text2pcap
72         tshark
73 )
74
75 # We want the wsug_* targets to depend on the tools help files.
76 # We want update_tools_help to be an independent target.
77 # We don't necessarily want to depend on building our executables before
78 # being able to build our documentation.
79 set(WSUG_TOOLS_HELP_FILES)
80 set(WSUG_TOOLS_PHONY_DEPS)
81
82 # General help output
83 foreach(th_command ${WSUG_TOOLS_HELP_COMMANDS})
84         set(th_file ${CMAKE_CURRENT_SOURCE_DIR}/wsug_src/${th_command}-h.txt)
85         set(th_phony ${th_command}_h_tools_help)
86         list(APPEND WSUG_TOOLS_HELP_FILES ${th_file})
87         list(APPEND WSUG_TOOLS_PHONY_DEPS ${th_phony})
88         add_custom_command(
89                 OUTPUT ${th_phony}
90                 COMMAND ${th_command} -h > ${th_file}
91                 DEPENDS ${th_command}
92         )
93 endforeach()
94
95 # Extra command output
96 # Note that these won't work on Windows unless we make -F and -T write
97 # to stdout and return 0 or wrap the commands similar to hhc.exe.
98 set(th_file ${CMAKE_CURRENT_SOURCE_DIR}/wsug_src/editcap-F.txt)
99 set(th_phony editcap_F_tools_help)
100 list(APPEND WSUG_TOOLS_HELP_FILES ${th_file})
101 list(APPEND WSUG_TOOLS_PHONY_DEPS ${th_phony})
102 add_custom_command(
103         OUTPUT ${th_phony}
104         COMMAND editcap -F > ${th_file}
105         DEPENDS editcap
106 )
107 set(th_file ${CMAKE_CURRENT_SOURCE_DIR}/wsug_src/editcap-T.txt)
108 set(th_phony editcap_T_tools_help)
109 list(APPEND WSUG_TOOLS_HELP_FILES ${th_file})
110 list(APPEND WSUG_TOOLS_PHONY_DEPS ${th_phony})
111 add_custom_command(
112         OUTPUT ${th_phony}
113         COMMAND editcap -T > ${th_file}
114         DEPENDS editcap
115 )
116
117 add_custom_target(update_tools_help
118         DEPENDS ${WSUG_TOOLS_PHONY_DEPS}
119 )
120
121 set(WSUG_FILES
122         wsug_src/WSUG_app_files.asciidoc
123         wsug_src/WSUG_app_howitworks.asciidoc
124         wsug_src/WSUG_app_protocols.asciidoc
125         wsug_src/WSUG_app_messages.asciidoc
126         wsug_src/WSUG_app_tools.asciidoc
127         wsug_src/WSUG_chapter_advanced.asciidoc
128         wsug_src/WSUG_chapter_build_install.asciidoc
129         wsug_src/WSUG_chapter_capture.asciidoc
130         wsug_src/WSUG_chapter_customize.asciidoc
131         wsug_src/WSUG_chapter_introduction.asciidoc
132         wsug_src/WSUG_chapter_io.asciidoc
133         wsug_src/WSUG_chapter_statistics.asciidoc
134         wsug_src/WSUG_chapter_telephony.asciidoc
135         wsug_src/WSUG_chapter_troubleshoot.asciidoc
136         wsug_src/WSUG_chapter_use.asciidoc
137         wsug_src/WSUG_chapter_work.asciidoc
138         wsug_src/WSUG_preface.asciidoc
139         ${COMMON_FILES}
140 )
141
142 set(WSUG_GRAPHICS
143         wsug_graphics/related-ack.png
144         wsug_graphics/related-current.png
145         wsug_graphics/related-dup-ack.png
146         wsug_graphics/related-first.png
147         wsug_graphics/related-last.png
148         wsug_graphics/related-other.png
149         wsug_graphics/related-request.png
150         wsug_graphics/related-response.png
151         wsug_graphics/related-segment.png
152         wsug_graphics/ws-analyze-menu.png
153         wsug_graphics/ws-bytes-pane-tabs.png
154         wsug_graphics/ws-bytes-pane.png
155         wsug_graphics/ws-capture-info.png
156         wsug_graphics/ws-capture-interfaces.png
157         wsug_graphics/ws-capture-interfaces-win32.png
158         wsug_graphics/ws-capture-menu.png
159         wsug_graphics/ws-capture-options.png
160         wsug_graphics/ws-capture-options-remote-capture.png
161         wsug_graphics/ws-capture-options-remote-interface.png
162         wsug_graphics/ws-capture-options-remote-settings.png
163         wsug_graphics/ws-capture-preferences.png
164         wsug_graphics/ws-choose-color-rule.png
165         wsug_graphics/ws-coloring-fields.png
166         wsug_graphics/ws-coloring-rules-dialog.png
167         wsug_graphics/ws-column-header-popup-menu.png
168         wsug_graphics/ws-decode-as-show.png
169         wsug_graphics/ws-decode-as.png
170         wsug_graphics/ws-column-header-popup-menu.png
171         wsug_graphics/ws-details-pane-popup-menu.png
172         wsug_graphics/ws-details-pane.png
173         wsug_graphics/ws-display-filter-tcp.png
174         wsug_graphics/ws-edit-menu.png
175         wsug_graphics/ws-enabled-protocols.png
176         wsug_graphics/ws-expert-colored-tree.png
177         wsug_graphics/ws-expert-column.png
178         wsug_graphics/ws-expert-infos.png
179         wsug_graphics/ws-export-objects.png
180         wsug_graphics/ws-export-pdml.png
181         wsug_graphics/ws-export-plain.png
182         wsug_graphics/ws-export-ps.png
183         wsug_graphics/ws-export-psml.png
184         wsug_graphics/ws-export-selected.png
185         wsug_graphics/ws-file-import.png
186         wsug_graphics/ws-file-menu.png
187         wsug_graphics/ws-file-set-dialog.png
188         wsug_graphics/ws-filter-add-expression.png
189         wsug_graphics/ws-filter-toolbar.png
190         wsug_graphics/ws-filters.png
191         wsug_graphics/ws-find-packet.png
192         wsug_graphics/ws-follow-stream.png
193         wsug_graphics/ws-go-menu.png
194         wsug_graphics/ws-goto-packet.png
195         wsug_graphics/ws-gui-colors-preferences.png
196         wsug_graphics/ws-gui-columns-preferences.png
197         wsug_graphics/ws-gui-config-profiles.png
198         wsug_graphics/ws-gui-font-preferences.png
199         wsug_graphics/ws-gui-layout-preferences.png
200         wsug_graphics/ws-gui-preferences.png
201         wsug_graphics/ws-help-menu.png
202         wsug_graphics/ws-internals-menu.png
203         wsug_graphics/ws-list-pane.png
204         wsug_graphics/ws-logo.png
205         wsug_graphics/ws-main-toolbar.png
206         wsug_graphics/ws-main.png
207         wsug_graphics/ws-menu.png
208         wsug_graphics/ws-merge-gtk24.png
209         wsug_graphics/ws-merge-win32.png
210         wsug_graphics/ws-nameresolution-preferences.png
211         wsug_graphics/ws-open-gtk24.png
212         wsug_graphics/ws-open-win32.png
213         wsug_graphics/ws-packet-format.png
214         wsug_graphics/ws-packet-pane-popup-menu.png
215         wsug_graphics/ws-packet-range.png
216         wsug_graphics/ws-packet-selected.png
217         wsug_graphics/ws-packet-sep-win.png
218         wsug_graphics/ws-print.png
219         wsug_graphics/ws-printing-preferences.png
220         wsug_graphics/ws-save-as-gtk24.png
221         wsug_graphics/ws-save-as-win32.png
222         wsug_graphics/ws-statistics-menu.png
223         wsug_graphics/ws-stats-conversations.png
224         wsug_graphics/ws-stats-endpoints.png
225         wsug_graphics/ws-stats-hierarchy.png
226         wsug_graphics/ws-stats-iographs.png
227         wsug_graphics/ws-stats-srt-dcerpc-filter.png
228         wsug_graphics/ws-stats-srt-dcerpc.png
229         wsug_graphics/ws-stats-summary.png
230         wsug_graphics/ws-stats-lte-mac-traffic.png
231         wsug_graphics/ws-stats-lte-rlc-traffic.png
232         wsug_graphics/ws-stats-wlan-traffic.png
233         wsug_graphics/ws-statusbar-empty.png
234         wsug_graphics/ws-statusbar-loaded.png
235         wsug_graphics/ws-statusbar-selected.png
236         wsug_graphics/ws-telephony-menu.png
237         wsug_graphics/ws-time-reference.png
238         wsug_graphics/ws-tools-menu.png
239         wsug_graphics/ws-view-menu.png
240         wsug_graphics/toolbar/autoscroll_24.png
241         wsug_graphics/toolbar/capture_filter_24.png
242         wsug_graphics/toolbar/capture_interfaces_24.png
243         wsug_graphics/toolbar/capture_options_24.png
244         wsug_graphics/toolbar/capture_restart_24.png
245         wsug_graphics/toolbar/capture_start_24.png
246         wsug_graphics/toolbar/capture_stop_24.png
247         wsug_graphics/toolbar/colorize_24.png
248         wsug_graphics/toolbar/display_filter_24.png
249         wsug_graphics/toolbar/resize_columns_24.png
250         wsug_graphics/toolbar/stock_add_24.png
251         wsug_graphics/toolbar/stock_apply_20.png
252         wsug_graphics/toolbar/stock_bottom_24.png
253         wsug_graphics/toolbar/stock_clear_24.png
254         wsug_graphics/toolbar/stock_close_24.png
255         wsug_graphics/toolbar/stock_colorselector_24.png
256         wsug_graphics/toolbar/stock_help_24.png
257         wsug_graphics/toolbar/stock_jump_to_24.png
258         wsug_graphics/toolbar/stock_left_arrow_24.png
259         wsug_graphics/toolbar/stock_open_24.png
260         wsug_graphics/toolbar/stock_preferences_24.png
261         wsug_graphics/toolbar/stock_print_24.png
262         wsug_graphics/toolbar/stock_properties_24.png
263         wsug_graphics/toolbar/stock_refresh_24.png
264         wsug_graphics/toolbar/stock_right_arrow_24.png
265         wsug_graphics/toolbar/stock_save_24.png
266         wsug_graphics/toolbar/stock_save_as_24.png
267         wsug_graphics/toolbar/stock_search_24.png
268         wsug_graphics/toolbar/stock_stop_24.png
269         wsug_graphics/toolbar/stock_top_24.png
270         wsug_graphics/toolbar/stock_zoom_1_24.png
271         wsug_graphics/toolbar/stock_zoom_in_24.png
272         wsug_graphics/toolbar/stock_zoom_out_24.png
273         ${COMMON_GRAPHICS}
274 )
275
276 set(WSDG_FILES
277         wsdg_src/WSDG_chapter_build_intro.asciidoc
278         wsdg_src/WSDG_chapter_capture.asciidoc
279         wsdg_src/WSDG_chapter_dissection.asciidoc
280         wsdg_src/WSDG_chapter_env_intro.asciidoc
281         wsdg_src/WSDG_chapter_libraries.asciidoc
282         wsdg_src/WSDG_chapter_quick_setup.asciidoc
283         wsdg_src/WSDG_chapter_sources.asciidoc
284         wsdg_src/WSDG_chapter_tools.asciidoc
285         wsdg_src/WSDG_chapter_userinterface.asciidoc
286         wsdg_src/WSDG_chapter_works.asciidoc
287         wsdg_src/WSDG_preface.asciidoc
288         wsluarm.asciidoc
289         ${COMMON_FILES}
290 )
291
292 set(WSDG_GRAPHICS
293         wsdg_graphics/ws-capture-sync.dia
294         wsdg_graphics/ws-capture-sync.png
295         wsdg_graphics/ws-capture_internals.dia
296         wsdg_graphics/ws-capture_internals.png
297         wsdg_graphics/ws-function-blocks.dia
298         wsdg_graphics/ws-function-blocks.png
299         wsdg_graphics/ws-logo.png
300         ${COMMON_GRAPHICS}
301 )
302
303 set(WSUG_SOURCE
304         ${WSUG_FILES}
305         ${WSUG_GRAPHICS}
306 )
307
308 if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
309         add_custom_command(
310                 OUTPUT ws.css
311                 COMMAND ${CMAKE_COMMAND} -E copy_if_different
312                         ${CMAKE_CURRENT_SOURCE_DIR}/ws.css
313                         ${CMAKE_CURRENT_BINARY_DIR}/ws.css
314                 DEPENDS
315                         ${CMAKE_CURRENT_SOURCE_DIR}/ws.css
316         )
317 endif()
318
319 set( WSUG_BUILT_DEPS ws.css ${WSUG_TOOLS_HELP_FILES})
320
321 set(WSDG_SOURCE
322         ${WSDG_FILES}
323         ${WSDG_GRAPHICS}
324 )
325
326 # Note: file order here MATTERS!
327 # new WSLUA_MODULE files must come right before any WSLUA_CONTINUE_MODULE
328 # files for the same module
329 set(WSLUA_MODULES
330         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_dumper.c
331         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_field.c
332         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_gui.c
333         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_int64.c
334         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_listener.c
335         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_pinfo.c
336         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_address.c
337         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_column.c
338         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_nstime.c
339         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_proto.c
340         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_dissector.c
341         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_pref.c
342         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_proto_expert.c
343         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_proto_field.c
344         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_tree.c
345         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_tvb.c
346         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_byte_array.c
347         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_file.c
348         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_file_handler.c
349         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_frame_info.c
350         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_capture_info.c
351         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_dir.c
352         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_util.c
353         ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_struct.c
354 )
355
356 # Empty file to trigger wsluarm generation.
357 ADD_CUSTOM_COMMAND(
358         OUTPUT
359                 wsluarm
360         COMMAND ${CMAKE_COMMAND} -E make_directory wsluarm_src
361         COMMAND ${PERL_EXECUTABLE}
362                 ${CMAKE_CURRENT_SOURCE_DIR}/make-wsluarm.pl
363                 ${WSLUA_MODULES}
364         COMMAND ${CMAKE_COMMAND} -E touch
365                 wsluarm
366         DEPENDS
367                 ${CMAKE_CURRENT_SOURCE_DIR}/make-wsluarm.pl
368                 ${WSLUA_MODULES}
369 )
370
371 set( WSDG_BUILT_DEPS ws.css wsluarm )
372
373 set( ASCIIDOC_CONF_FILES
374         asciidoc.conf
375         asciidoctor-asciidoc.conf
376         attributes.asciidoc
377 )
378
379 if(ENABLE_HTML_GUIDES OR ENABLE_PDF_GUIDES OR ENABLE_CHM_GUIDES)
380         # Generate the DocBook sources of user and developer guides
381
382         ASCIIDOC2DOCBOOK(user-guide.asciidoc ASCIIDOC_CONF_FILES WSUG_SOURCE WSUG_BUILT_DEPS)
383         add_custom_target(user_guide_docbook DEPENDS generate_user-guide.xml)
384         set_target_properties(user_guide_docbook PROPERTIES FOLDER "Docbook")
385
386         ASCIIDOC2DOCBOOK(developer-guide.asciidoc ASCIIDOC_CONF_FILES WSDG_SOURCE WSDG_BUILT_DEPS)
387         add_custom_target(developer_guide_docbook DEPENDS generate_developer-guide.xml)
388         set_target_properties(developer_guide_docbook PROPERTIES FOLDER "Docbook")
389
390         # Top-level guide targets.
391
392         add_custom_target(user_guides DEPENDS user_guide_docbook)
393         set_target_properties(user_guides PROPERTIES FOLDER "Docbook")
394
395         add_custom_target(developer_guides DEPENDS developer_guide_docbook)
396         set_target_properties(developer_guides PROPERTIES FOLDER "Docbook")
397
398         add_custom_target(all_guides ALL DEPENDS user_guides developer_guides )
399         set_target_properties(all_guides PROPERTIES FOLDER "Docbook")
400 endif()
401
402 # User's Guide chain.
403 if(ENABLE_HTML_GUIDES)
404         XML2HTML(
405                 user_guide
406                 wsug
407                 single-page
408                 user-guide.xml
409                 WSUG_GRAPHICS
410         )
411
412         XML2HTML(
413                 user_guide
414                 wsug
415                 chunked
416                 user-guide.xml
417                 WSUG_GRAPHICS
418         )
419         add_custom_target(
420                 user_guide_html
421                 DEPENDS
422                         wsug_html/index.html
423                         wsug_html_chunked/index.html
424         )
425         set_target_properties(user_guide_html PROPERTIES FOLDER "Docbook")
426         add_dependencies(user_guides user_guide_html)
427 endif()
428
429 if(ENABLE_PDF_GUIDES)
430         # To do:
431         # - Merge A4 and letter into the smallest dimension of each format.
432         #   Use   --stringparam  page.height <letter-height>mm --stringparam  page.width <at-width>mm
433         #   Test the effect of this on letter and a4 printers first (ps and non-ps).
434         # - Generate PDFs using AsciiDoc.
435
436         XML2PDF(
437                 user_guide
438                 user-guide-a4.pdf
439                 user-guide.xml
440                 custom_layer_pdf.xsl
441                 A4
442         )
443
444         XML2PDF(
445                 user_guide
446                 user-guide-us.pdf
447                 user-guide.xml
448                 custom_layer_pdf.xsl
449                 letter
450         )
451         add_custom_target(
452                 user_guide_pdf_a4
453                 DEPENDS
454                         user-guide-a4.pdf
455         )
456         set_target_properties(user_guide_pdf_a4 PROPERTIES FOLDER "Docbook")
457         add_custom_target(
458                 user_guide_pdf_us
459                 DEPENDS
460                         user-guide-us.pdf
461         )
462         set_target_properties(user_guide_pdf_us PROPERTIES FOLDER "Docbook")
463         add_dependencies(user_guides user_guide_pdf_a4 user_guide_pdf_us)
464 endif()
465
466 if(ENABLE_CHM_GUIDES)
467         XML2HHP(user_guide wsug user-guide.xml)
468         HHP2CHM(user-guide.hhp)
469         add_custom_target(
470                 user_guide_chm
471                 DEPENDS
472                         user-guide.chm
473         )
474         set_target_properties(user_guide_chm PROPERTIES FOLDER "Docbook")
475         add_dependencies(user_guides user_guide_chm)
476 endif()
477
478 # Developer's Guide chain.
479 if(ENABLE_HTML_GUIDES)
480         XML2HTML(
481                 developer_guide
482                 wsdg
483                 single-page
484                 developer-guide.xml
485                 WSDG_GRAPHICS
486         )
487
488         XML2HTML(
489                 developer_guide
490                 wsdg
491                 chunked
492                 developer-guide.xml
493                 WSDG_GRAPHICS
494         )
495         add_custom_target(
496                 developer_guide_html
497                 DEPENDS
498                         wsdg_html/index.html
499                         wsdg_html_chunked/index.html
500         )
501         set_target_properties(developer_guide_html PROPERTIES FOLDER "Docbook")
502         add_dependencies(developer_guides developer_guide_html)
503 endif()
504
505 if(ENABLE_PDF_GUIDES)
506         XML2PDF(
507                 developer_guide
508                 developer-guide-a4.pdf
509                 developer-guide.xml
510                 custom_layer_pdf.xsl
511                 A4
512         )
513
514         XML2PDF(
515                 developer_guide
516                 developer-guide-us.pdf
517                 developer-guide.xml
518                 custom_layer_pdf.xsl
519                 letter
520         )
521         add_custom_target(
522                 developer_guide_pdf_a4
523                 DEPENDS
524                         developer-guide-a4.pdf
525         )
526         set_target_properties(developer_guide_pdf_a4 PROPERTIES FOLDER "Docbook")
527         add_custom_target(
528                 developer_guide_pdf_us
529                 DEPENDS
530                         developer-guide-us.pdf
531         )
532         set_target_properties(developer_guide_pdf_us PROPERTIES FOLDER "Docbook")
533         add_dependencies(developer_guides developer_guide_pdf_a4 developer_guide_pdf_us)
534 endif()
535
536 if(ENABLE_CHM_GUIDES)
537         XML2HHP(developer_guide wsdg developer-guide.xml)
538         HHP2CHM(developer-guide.hhp)
539         add_custom_target(
540                 developer_guide_chm
541                 DEPENDS
542                         developer-guide.chm
543         )
544         set_target_properties(developer_guide_chm PROPERTIES FOLDER "Docbook")
545         add_dependencies(developer_guides developer_guide_chm)
546 endif()
547
548 # release_notes: release-notes.html release-notes.txt release-notes-a4.pdf release-notes-us.pdf
549
550 add_custom_target( release_notes_html DEPENDS ws.css release-notes.html )
551 set_target_properties(release_notes_html PROPERTIES FOLDER "Docbook")
552 add_custom_target( release_notes_txt DEPENDS release-notes.txt )
553 set_target_properties(release_notes_txt PROPERTIES FOLDER "Docbook")
554
555 # Force serial execution so that separate a2x instances don't trip on each other
556 add_dependencies ( release_notes_txt release_notes_html )
557
558 add_custom_target( release_notes )
559 set_target_properties(release_notes PROPERTIES FOLDER "Docbook")
560 add_dependencies ( release_notes release_notes_txt release_notes_html )
561
562 add_custom_target(
563         news
564         COMMAND ${CMAKE_COMMAND} -E copy_if_different
565                 ${CMAKE_CURRENT_BINARY_DIR}/release-notes.txt
566                 ${CMAKE_SOURCE_DIR}/NEWS
567         DEPENDS
568                 ${CMAKE_CURRENT_BINARY_DIR}/release-notes.txt
569 )
570 set_target_properties(news PROPERTIES FOLDER "Docbook")
571
572 if( ASCIIDOC_FOUND )
573         ASCIIDOC2HTML(
574                 release-notes.html
575                 release-notes.asciidoc
576                 "${ASCIIDOC_CONF_FILES}"
577         )
578
579         ASCIIDOC2TXT(
580                 release-notes.txt
581                 release-notes.asciidoc
582                 "${ASCIIDOC_CONF_FILES}"
583         )
584 endif()
585
586 #ASCIIDOC2PDF(
587 #       release-notes-a4.pdf
588 #       release-notes.asciidoc
589 #       "${ASCIIDOC_CONF_FILES}"
590 #       A4
591 #)
592
593 #ASCIIDOC2PDF(
594 #       release-notes-us.pdf
595 #       release-notes.asciidoc
596 #       "${ASCIIDOC_CONF_FILES}"
597 #       letter
598 #)
599
600 #
601 # Editor modelines  -  http://www.wireshark.org/tools/modelines.html
602 #
603 # Local variables:
604 # c-basic-offset: 8
605 # tab-width: 8
606 # indent-tabs-mode: t
607 # End:
608 #
609 # vi: set shiftwidth=8 tabstop=8 noexpandtab:
610 # :indentSize=8:tabSize=8:noTabs=false:
611 #