# By Gerald Combs <gerald@wireshark.org>
# Copyright 1998 Gerald Combs
#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# SPDX-License-Identifier: GPL-2.0-or-later
#
-find_package( FOP ) # Call before XSLTPROC
-find_package( LYNX )
+# To do:
+# - Rename *.asciidoc to *.adoc
+# - Make the build targets top-level on Windows, similar to the NSIS,
+# WiX, and PortableApps targets?
+
+find_package( Asciidoctor 1.5 )
find_package( XSLTPROC )
-find_package( XMLLINT )
-find_package( ASCIIDOC )
-set(WSUG_FILES
- wsug_src/WSUG_app_files.xml
- wsug_src/WSUG_app_howitworks.xml
- wsug_src/WSUG_app_messages.xml
- wsug_src/WSUG_app_protocols.xml
- wsug_src/WSUG_app_tools.xml
- wsug_src/WSUG_chapter_advanced.xml
- WSUG_chapter_build_install.xml
- wsug_src/WSUG_chapter_capture.xml
- wsug_src/WSUG_chapter_customize.xml
- WSUG_chapter_introduction.xml
- wsug_src/WSUG_chapter_io.xml
- WSUG_chapter_statistics.xml
- wsug_src/WSUG_chapter_telephony.xml
- wsug_src/WSUG_chapter_troubleshoot.xml
- wsug_src/WSUG_chapter_use.xml
- wsug_src/WSUG_chapter_work.xml
- wsug_src/WSUG_meta_info.xml
- WSUG_preface.xml
- wsluarm.xml
- ws.css
+function(set_docbook_target_properties _target)
+ set_target_properties(${_target} PROPERTIES
+ FOLDER "Docbook"
+ EXCLUDE_FROM_DEFAULT_BUILD True
+ )
+endfunction(set_docbook_target_properties)
+
+if(WIN32)
+ find_package( HTMLHelp )
+ if(HTML_HELP_COMPILER)
+ # We do not need the HTML Help headers and library, just the
+ # compiler. To avoid confusion, report the package as found.
+ # https://gitlab.kitware.com/cmake/cmake/issues/15886
+ set(HTMLHelp_FOUND 1)
+ endif()
+ macro( HHP2CHM _hhpsource )
+ get_filename_component( _source_base_name ${_hhpsource} NAME_WE )
+
+ add_custom_command(
+ OUTPUT ${_output_chm}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ # The number and order of arguments MUST match hhc.cmake.
+ COMMAND ${CMAKE_COMMAND} -P
+ ${CMAKE_SOURCE_DIR}/cmake/modules/hhc.cmake
+ "${HTML_HELP_COMPILER}"
+ ${_hhpsource}
+ DEPENDS
+ ${_hhpsource}
+ )
+ endmacro()
+else()
+ macro( HHP2CHM _hhpsource )
+ # Dummy.
+ endmacro()
+endif()
+
+set(COMMON_FILES
+ common_src/GPL_appendix.asciidoc
+)
+
+set(COMMON_GRAPHICS
+ common_graphics/note.svg
+ common_graphics/tip.svg
+ common_graphics/warning.svg
+)
+
+set(WSUG_TOOLS_HELP_COMMANDS
+ capinfos
+ dumpcap
+ editcap
+ mergecap
+ rawshark
+ reordercap
+ text2pcap
+ tshark
+)
+
+# We want the wsug_* targets to depend on the tools help files.
+# We want update_tools_help to be an independent target.
+# We don't necessarily want to depend on building our executables before
+# being able to build our documentation.
+set(WSUG_TOOLS_HELP_FILES)
+set(WSUG_TOOLS_PHONY_DEPS)
+set(GUIDE_INSTALL_DIRS)
+
+# General help output
+foreach(th_command ${WSUG_TOOLS_HELP_COMMANDS})
+ set(th_file ${CMAKE_CURRENT_SOURCE_DIR}/wsug_src/${th_command}-h.txt)
+ set(th_phony ${th_command}_h_tools_help)
+ list(APPEND WSUG_TOOLS_HELP_FILES ${th_file})
+ list(APPEND WSUG_TOOLS_PHONY_DEPS ${th_phony})
+ add_custom_command(
+ OUTPUT ${th_phony}
+ COMMAND ${th_command} -h > ${th_file}
+ DEPENDS ${th_command}
+ )
+endforeach()
+
+# Extra command output
+# Note that these won't work on Windows unless we make -F and -T write
+# to stdout and return 0 or wrap the commands similar to hhc.exe.
+set(th_file ${CMAKE_CURRENT_SOURCE_DIR}/wsug_src/editcap-F.txt)
+set(th_phony editcap_F_tools_help)
+list(APPEND WSUG_TOOLS_HELP_FILES ${th_file})
+list(APPEND WSUG_TOOLS_PHONY_DEPS ${th_phony})
+add_custom_command(
+ OUTPUT ${th_phony}
+ COMMAND editcap -F > ${th_file}
+ DEPENDS editcap
+)
+set(th_file ${CMAKE_CURRENT_SOURCE_DIR}/wsug_src/editcap-T.txt)
+set(th_phony editcap_T_tools_help)
+list(APPEND WSUG_TOOLS_HELP_FILES ${th_file})
+list(APPEND WSUG_TOOLS_PHONY_DEPS ${th_phony})
+add_custom_command(
+ OUTPUT ${th_phony}
+ COMMAND editcap -T > ${th_file}
+ DEPENDS editcap
)
-set(WSDG_ASCIIDOC_FILES
+add_custom_target(update_tools_help
+ DEPENDS ${WSUG_TOOLS_PHONY_DEPS}
+)
+set_docbook_target_properties(update_tools_help)
+
+set(WSUG_FILES
+ wsug_src/WSUG_app_files.asciidoc
+ wsug_src/WSUG_app_howitworks.asciidoc
+ wsug_src/WSUG_app_protocols.asciidoc
+ wsug_src/WSUG_app_messages.asciidoc
+ wsug_src/WSUG_app_tools.asciidoc
+ wsug_src/WSUG_chapter_advanced.asciidoc
wsug_src/WSUG_chapter_build_install.asciidoc
+ wsug_src/WSUG_chapter_capture.asciidoc
+ wsug_src/WSUG_chapter_customize.asciidoc
wsug_src/WSUG_chapter_introduction.asciidoc
+ wsug_src/WSUG_chapter_io.asciidoc
wsug_src/WSUG_chapter_statistics.asciidoc
+ wsug_src/WSUG_chapter_telephony.asciidoc
+ wsug_src/WSUG_chapter_troubleshoot.asciidoc
+ wsug_src/WSUG_chapter_use.asciidoc
+ wsug_src/WSUG_chapter_work.asciidoc
wsug_src/WSUG_preface.asciidoc
+ ${COMMON_FILES}
)
set(WSUG_GRAPHICS
+ wsug_graphics/related-ack.png
+ wsug_graphics/related-current.png
+ wsug_graphics/related-dup-ack.png
+ wsug_graphics/related-first.png
+ wsug_graphics/related-last.png
+ wsug_graphics/related-other.png
+ wsug_graphics/related-request.png
+ wsug_graphics/related-response.png
+ wsug_graphics/related-segment.png
wsug_graphics/ws-analyze-menu.png
wsug_graphics/ws-bytes-pane-tabs.png
wsug_graphics/ws-bytes-pane.png
wsug_graphics/ws-capture-info.png
+ wsug_graphics/ws-capture-interface-details.png
wsug_graphics/ws-capture-interfaces.png
wsug_graphics/ws-capture-interfaces-win32.png
wsug_graphics/ws-capture-menu.png
wsug_graphics/ws-capture-options.png
+ wsug_graphics/ws-capture-options-compile-selected-bpfs.png
+ wsug_graphics/ws-capture-options-manage-interfaces-local.png
+ wsug_graphics/ws-capture-options-manage-interfaces-pipes.png
+ wsug_graphics/ws-capture-options-manage-interfaces-remote-plus.png
+ wsug_graphics/ws-capture-options-manage-interfaces-remote.png
+ wsug_graphics/ws-capture-options-manage-interfaces.png
+ wsug_graphics/ws-capture-options-output.png
wsug_graphics/ws-capture-options-remote-capture.png
wsug_graphics/ws-capture-options-remote-interface.png
wsug_graphics/ws-capture-options-remote-settings.png
+ wsug_graphics/ws-capture-options-settings.png
wsug_graphics/ws-capture-preferences.png
wsug_graphics/ws-choose-color-rule.png
wsug_graphics/ws-coloring-fields.png
wsug_graphics/ws-column-header-popup-menu.png
wsug_graphics/ws-decode-as-show.png
wsug_graphics/ws-decode-as.png
- wsug_graphics/ws-column-header-popup-menu.png
wsug_graphics/ws-details-pane-popup-menu.png
wsug_graphics/ws-details-pane.png
wsug_graphics/ws-display-filter-tcp.png
- wsug_graphics/ws-edit-color-rule-dialog.png
wsug_graphics/ws-edit-menu.png
wsug_graphics/ws-enabled-protocols.png
wsug_graphics/ws-expert-colored-tree.png
wsug_graphics/ws-gui-columns-preferences.png
wsug_graphics/ws-gui-config-profiles.png
wsug_graphics/ws-gui-font-preferences.png
+ wsug_graphics/ws-gui-interface-options.png
wsug_graphics/ws-gui-layout-preferences.png
wsug_graphics/ws-gui-preferences.png
wsug_graphics/ws-help-menu.png
wsug_graphics/ws-main-toolbar.png
wsug_graphics/ws-main.png
wsug_graphics/ws-menu.png
- wsug_graphics/ws-merge-gtk20.png
wsug_graphics/ws-merge-gtk24.png
wsug_graphics/ws-merge-win32.png
wsug_graphics/ws-nameresolution-preferences.png
- wsug_graphics/ws-open-gtk20.png
wsug_graphics/ws-open-gtk24.png
wsug_graphics/ws-open-win32.png
wsug_graphics/ws-packet-format.png
wsug_graphics/ws-packet-sep-win.png
wsug_graphics/ws-print.png
wsug_graphics/ws-printing-preferences.png
- wsug_graphics/ws-save-as-gtk20.png
wsug_graphics/ws-save-as-gtk24.png
wsug_graphics/ws-save-as-win32.png
wsug_graphics/ws-statistics-menu.png
+ wsug_graphics/ws-stats-compare.png
wsug_graphics/ws-stats-conversations.png
wsug_graphics/ws-stats-endpoints.png
wsug_graphics/ws-stats-hierarchy.png
wsug_graphics/ws-stats-lte-rlc-traffic.png
wsug_graphics/ws-stats-wlan-traffic.png
wsug_graphics/ws-statusbar-empty.png
+ wsug_graphics/ws-statusbar-filter.png
wsug_graphics/ws-statusbar-loaded.png
+ wsug_graphics/ws-statusbar-profile.png
wsug_graphics/ws-statusbar-selected.png
+ wsug_graphics/ws-tcp-analysis.png
+ wsug_graphics/ws-tel-rtpstream-analysis.png
wsug_graphics/ws-telephony-menu.png
wsug_graphics/ws-time-reference.png
wsug_graphics/ws-tools-menu.png
wsug_graphics/ws-view-menu.png
- wsug_graphics/note.png
- wsug_graphics/tip.png
- wsug_graphics/warning.png
wsug_graphics/toolbar/autoscroll_24.png
wsug_graphics/toolbar/capture_filter_24.png
wsug_graphics/toolbar/capture_interfaces_24.png
wsug_graphics/toolbar/stock_zoom_1_24.png
wsug_graphics/toolbar/stock_zoom_in_24.png
wsug_graphics/toolbar/stock_zoom_out_24.png
+ ${COMMON_GRAPHICS}
)
set(WSDG_FILES
wsdg_src/WSDG_chapter_userinterface.asciidoc
wsdg_src/WSDG_chapter_works.asciidoc
wsdg_src/WSDG_preface.asciidoc
- ws.css
+ wsluarm.asciidoc
+ ${COMMON_FILES}
)
set(WSDG_GRAPHICS
wsdg_graphics/ws-function-blocks.dia
wsdg_graphics/ws-function-blocks.png
wsdg_graphics/ws-logo.png
- wsdg_graphics/note.png
- wsdg_graphics/tip.png
- wsdg_graphics/warning.png
+ ${COMMON_GRAPHICS}
)
-# user-guide.xml must be first in the list
set(WSUG_SOURCE
- user-guide.xml
- git_version.xml
- wsluarm
${WSUG_FILES}
${WSUG_GRAPHICS}
)
-MACRO( ASCIIDOC2DOCBOOK _asciidocsource _conffile )
- GET_FILENAME_COMPONENT( _source_base_name ${_asciidocsource} NAME_WE )
- set( A2X_HTML_OPTS --stylesheet=ws.css )
- set( _output_xml ${_source_base_name}.xml )
- set( _output_dbk ${_source_base_name}.dbk )
- ADD_CUSTOM_COMMAND(
- OUTPUT
- ${_output_xml}
- # XXX - Output to a specific directory, e.g. wsdg_generated_src
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- COMMAND ${A2X_EXECUTABLE}
- --verbose
- --attribute=docinfo
- --destination-dir=${CMAKE_CURRENT_BINARY_DIR}
- --asciidoc-opts="--conf-file=${CMAKE_CURRENT_SOURCE_DIR}/${_conffile}"
- --no-xmllint
- --format=docbook
- --fop
- ${A2X_HTML_OPTS}
- ${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
- DEPENDS
- ${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
- ${CMAKE_CURRENT_SOURCE_DIR}/${_conffile}
- ${WSDG_GENERATED_FILES}
- )
-ENDMACRO()
-
-ASCIIDOC2DOCBOOK( developer-guide.asciidoc asciidoc.conf )
-
-SET( WSDG_GENERATED_FILES )
-# Convert an AsciiDoc document to a DocBook chapter
-# Used for chapter-by-chapter conversion from DocBook to AsciiDoc.
-# Can be removed after the User's Guide is converted.
-# .asciidoc -> whole book (.dbk) -> chapter (.xml)
-MACRO( ASCIIDOC2CHAPTER _asciidocsource _conffile )
- GET_FILENAME_COMPONENT( _source_base_name ${_asciidocsource} NAME_WE )
- set( A2X_HTML_OPTS --stylesheet=ws.css )
- set( _output_xml ${_source_base_name}.xml )
- set( _output_dbk ${_source_base_name}.dbk )
- ADD_CUSTOM_COMMAND(
- OUTPUT
- ${_output_xml} ${_output_dbk}
- # XXX - Output to a specific directory, e.g. wsdg_generated_src
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- COMMAND ${A2X_EXECUTABLE}
- --verbose
- --destination-dir=${CMAKE_CURRENT_BINARY_DIR}
- --asciidoc-opts="--conf-file=${CMAKE_CURRENT_SOURCE_DIR}/${_conffile}"
- --no-xmllint
- --fop
- --format=docbook --doctype=book
- ${A2X_HTML_OPTS}
- ${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
- COMMAND mv
- ${_output_xml}
- ${_output_dbk}
- COMMAND ${XMLLINT_EXECUTABLE}
- --xpath '//chapter | //preface'
- ${_output_dbk}
- > ${_output_xml}
+if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
+ add_custom_command(
+ OUTPUT ws.css
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${CMAKE_CURRENT_SOURCE_DIR}/ws.css
+ ${CMAKE_CURRENT_BINARY_DIR}/ws.css
DEPENDS
- ${_outptudir}
- ${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
- ${CMAKE_CURRENT_SOURCE_DIR}/${_conffile}
+ ${CMAKE_CURRENT_SOURCE_DIR}/ws.css
)
- LIST( APPEND WSDG_GENERATED_FILES ${CMAKE_CURRENT_BINARY_DIR}/${_output_xml} )
-ENDMACRO()
+endif()
-FOREACH(ASCIIDOCFILE ${WSDG_ASCIIDOC_FILES})
- ASCIIDOC2CHAPTER(
- ${ASCIIDOCFILE}
- asciidoc.conf
- )
-ENDFOREACH()
-
-ADD_CUSTOM_TARGET( wsug_generated_src DEPENDS ${WSDG_GENERATED_FILES} )
+set( WSUG_BUILT_DEPS ws.css ${WSUG_TOOLS_HELP_FILES})
-# developer-guide.xml must be first in the list
set(WSDG_SOURCE
- developer-guide.xml
- git_version.xml
${WSDG_FILES}
${WSDG_GRAPHICS}
)
+# Note: file order here MATTERS!
+# new WSLUA_MODULE files must come right before any WSLUA_CONTINUE_MODULE
+# files for the same module
set(WSLUA_MODULES
${CMAKE_SOURCE_DIR}/epan/wslua/wslua_dumper.c
${CMAKE_SOURCE_DIR}/epan/wslua/wslua_field.c
${CMAKE_SOURCE_DIR}/epan/wslua/wslua_int64.c
${CMAKE_SOURCE_DIR}/epan/wslua/wslua_listener.c
${CMAKE_SOURCE_DIR}/epan/wslua/wslua_pinfo.c
+ ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_address.c
+ ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_column.c
+ ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_nstime.c
${CMAKE_SOURCE_DIR}/epan/wslua/wslua_proto.c
+ ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_dissector.c
+ ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_pref.c
+ ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_proto_expert.c
+ ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_proto_field.c
${CMAKE_SOURCE_DIR}/epan/wslua/wslua_tree.c
${CMAKE_SOURCE_DIR}/epan/wslua/wslua_tvb.c
+ ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_byte_array.c
${CMAKE_SOURCE_DIR}/epan/wslua/wslua_file.c
+ ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_file_handler.c
+ ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_frame_info.c
+ ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_capture_info.c
${CMAKE_SOURCE_DIR}/epan/wslua/wslua_dir.c
${CMAKE_SOURCE_DIR}/epan/wslua/wslua_util.c
${CMAKE_SOURCE_DIR}/epan/wslua/wslua_struct.c
)
+# Empty file to trigger wsluarm generation.
ADD_CUSTOM_COMMAND(
OUTPUT
- git_version.xml
- COMMAND ${SH}
- ${CMAKE_CURRENT_SOURCE_DIR}/check_git_version.sh
+ wsluarm
+ COMMAND ${CMAKE_COMMAND} -E make_directory wsluarm_src
+ COMMAND ${PERL_EXECUTABLE}
+ ${CMAKE_CURRENT_SOURCE_DIR}/make-wsluarm.pl
+ ${WSLUA_MODULES}
+ COMMAND ${CMAKE_COMMAND} -E touch
+ wsluarm
DEPENDS
- ${CMAKE_CURRENT_SOURCE_DIR}/check_git_version.sh
+ ${CMAKE_CURRENT_SOURCE_DIR}/make-wsluarm.pl
+ ${WSLUA_MODULES}
)
-add_custom_target(
- user_guides ALL
- DEPENDS
- wsluarm
- wsug_html_chunked/index.html
- wsug_html/index.html
- user-guide-a4.pdf
- user-guide-us.pdf
-)
+set( WSDG_BUILT_DEPS ws.css wsluarm )
-VALIDATE_XML(
- wsug.validated
- WSUG_SOURCE
+set( ASCIIDOC_CONF_FILES
+ attributes.asciidoc
+ # XXX Add macros
)
-XML2HTML(
- wsug.validated
- wsug_html/index.html
- single-page
- WSUG_SOURCE
- WSUG_GRAPHICS
-)
+if(ASCIIDOCTOR_EXECUTABLE)
+ # Generate the DocBook sources of user and developer guides
-XML2HTML(
- wsug.validated
- wsug_html_chunked/index.html
- chunked
- WSUG_SOURCE
- WSUG_GRAPHICS
-)
+ ASCIIDOCTOR2DOCBOOK(user-guide.asciidoc ${ASCIIDOC_CONF_FILES} ${WSUG_SOURCE} ${WSUG_BUILT_DEPS})
+ add_custom_target(user_guide_docbook DEPENDS generate_user-guide.xml)
+ set_docbook_target_properties(user_guide_docbook)
-# 2do: Merge A4 and letter into the smallest dimension of each format.
-# Use --stringparam page.height <letter-height>mm --stringparam page.width <at-width>mm
-# Test the effect of this on letter and a4 printers first (ps and non-ps).
+ ASCIIDOCTOR2DOCBOOK(developer-guide.asciidoc ${ASCIIDOC_CONF_FILES} ${WSDG_SOURCE} ${WSDG_BUILT_DEPS})
+ add_custom_target(developer_guide_docbook DEPENDS generate_developer-guide.xml)
+ set_docbook_target_properties(developer_guide_docbook)
-XML2PDF(
- user-guide-a4.pdf
- WSUG_SOURCE
- custom_layer_pdf.xsl
- A4
-)
+ # Top-level guide targets.
-XML2PDF(
- user-guide-us.pdf
- WSUG_SOURCE
- custom_layer_pdf.xsl
- letter
-)
+ add_custom_target(user_guides DEPENDS user_guide_docbook)
+ set_docbook_target_properties(user_guides)
-add_custom_target(
- developer_guides ALL
- DEPENDS
- wsluarm
- wsdg_html_chunked/index.html
- wsdg_html/index.html
- developer-guide-a4.pdf
- developer-guide-us.pdf
-)
+ add_custom_target(developer_guides DEPENDS developer_guide_docbook)
+ set_docbook_target_properties(developer_guides)
-VALIDATE_XML(
- wsdg.validated
- WSDG_SOURCE
-)
+ add_custom_target(all_guides DEPENDS user_guides developer_guides )
+ set_docbook_target_properties(all_guides)
+endif()
-XML2HTML(
- wsdg.validated
- wsdg_html/index.html
- single-page
- WSDG_SOURCE
- WSDG_GRAPHICS
-)
+# User's Guide chain.
+if(ASCIIDOCTOR_EXECUTABLE AND XSLTPROC_EXECUTABLE)
+ XML2HTML(
+ user_guide
+ wsug
+ single-page
+ user-guide.xml
+ WSUG_GRAPHICS
+ )
-XML2HTML(
- wsdg.validated
- wsdg_html_chunked/index.html
- chunked
- WSDG_SOURCE
- WSDG_GRAPHICS
-)
+ XML2HTML(
+ user_guide
+ wsug
+ chunked
+ user-guide.xml
+ WSUG_GRAPHICS
+ )
+ add_custom_target(
+ user_guide_html
+ DEPENDS
+ wsug_html/index.html
+ wsug_html_chunked/index.html
+ )
+ set_docbook_target_properties(user_guide_html)
+ add_dependencies(user_guides user_guide_html)
+ list(APPEND GUIDE_INSTALL_DIRS ${CMAKE_CURRENT_BINARY_DIR}/wsug_html_chunked)
+endif()
-XML2PDF(
- developer-guide-a4.pdf
- WSDG_SOURCE
- custom_layer_pdf.xsl
- A4
-)
+if(ASCIIDOCTOR_EXECUTABLE)
+ ASCIIDOCTOR2PDF(user-guide.asciidoc ${WSUG_SOURCE} ${WSUG_BUILT_DEPS})
-XML2PDF(
- developer-guide-us.pdf
- WSDG_SOURCE
- custom_layer_pdf.xsl
- letter
-)
+ add_custom_target(
+ user_guide_pdf
+ DEPENDS
+ user-guide.pdf
+ )
+ set_docbook_target_properties(user_guide_pdf)
+ add_dependencies(user_guides user_guide_pdf)
+endif()
+
+if(WIN32 AND ASCIIDOCTOR_EXECUTABLE)
+ XML2HHP(user_guide wsug user-guide.xml)
+ HHP2CHM(user-guide.hhp)
+ add_custom_target(
+ user_guide_chm
+ DEPENDS
+ user-guide.chm
+ )
+ set_docbook_target_properties(user_guide_chm)
+ add_dependencies(user_guides user_guide_chm)
+endif()
+
+# Developer's Guide chain.
+if(ASCIIDOCTOR_EXECUTABLE AND XSLTPROC_EXECUTABLE)
+ XML2HTML(
+ developer_guide
+ wsdg
+ single-page
+ developer-guide.xml
+ WSDG_GRAPHICS
+ )
-# release_notes: release-notes.html release-notes.txt release-notes-a4.pdf release-notes-us.pdf
+ XML2HTML(
+ developer_guide
+ wsdg
+ chunked
+ developer-guide.xml
+ WSDG_GRAPHICS
+ )
+ add_custom_target(
+ developer_guide_html
+ DEPENDS
+ wsdg_html/index.html
+ wsdg_html_chunked/index.html
+ )
+ set_docbook_target_properties(developer_guide_html)
+ add_dependencies(developer_guides developer_guide_html)
+ list(APPEND GUIDE_INSTALL_DIRS ${CMAKE_CURRENT_BINARY_DIR}/wsdg_html_chunked)
+endif()
-add_custom_target(
- release_notes ALL
- DEPENDS
- release-notes.html
- release-notes.txt
- release-notes-a4.pdf
- release-notes-us.pdf
- ${CMAKE_SOURCE_DIR}/NEWS
-)
+if(ASCIIDOCTOR_EXECUTABLE)
+ ASCIIDOCTOR2PDF(developer-guide.asciidoc ${WSDG_SOURCE} ${WSDG_BUILT_DEPS})
-ADD_CUSTOM_COMMAND(
- OUTPUT
- ${CMAKE_SOURCE_DIR}/NEWS
- COMMAND cp
- ${CMAKE_CURRENT_BINARY_DIR}/release-notes.txt
- ${CMAKE_SOURCE_DIR}/NEWS
- DEPENDS
- ${CMAKE_CURRENT_BINARY_DIR}/release-notes.txt
-)
+ add_custom_target(
+ developer_guide_pdf
+ DEPENDS
+ developer-guide.pdf
+ )
+ set_docbook_target_properties(developer_guide_pdf)
+ add_dependencies(developer_guides developer_guide_pdf)
+endif()
+
+if(WIN32 AND ASCIIDOCTOR_EXECUTABLE)
+ XML2HHP(developer_guide wsdg developer-guide.xml)
+ HHP2CHM(developer-guide.hhp)
+ add_custom_target(
+ developer_guide_chm
+ DEPENDS
+ developer-guide.chm
+ )
+ set_docbook_target_properties(developer_guide_chm)
+ add_dependencies(developer_guides developer_guide_chm)
+endif()
+
+if (GUIDE_INSTALL_DIRS)
+ # The installation location and DOC_DIR in ui/help_url.c must
+ # match.
+ add_custom_target(install_guides
+ COMMAND ${CMAKE_COMMAND} -P
+ ${CMAKE_SOURCE_DIR}/cmake/modules/FileInstall.cmake
+ ${GUIDE_INSTALL_DIRS}
+ ${CMAKE_INSTALL_FULL_DOCDIR}
+ DEPENDS
+ user_guide_html developer_guide_html
+ )
+ set_docbook_target_properties(install_guides)
+endif()
-ASCIIDOC2HTML(
- release-notes.html
- release-notes.asciidoc
- asciidoc.conf
-)
+# release_notes: release-notes.html release-notes.txt
-ASCIIDOC2TXT(
- release-notes.txt
- release-notes.asciidoc
- asciidoc.conf
-)
+add_custom_target( release_notes_html DEPENDS release-notes.html )
+set_docbook_target_properties(release_notes_html)
+add_custom_target( release_notes_txt DEPENDS release-notes.txt )
+set_docbook_target_properties(release_notes_txt)
-ASCIIDOC2PDF(
- release-notes-a4.pdf
- release-notes.asciidoc
- asciidoc.conf
- A4
-)
+# Force serial execution so that separate asciidoctor instances don't
+# trip on each other
+# add_dependencies ( release_notes_txt release_notes_html )
-ASCIIDOC2PDF(
- release-notes-us.pdf
- release-notes.asciidoc
- asciidoc.conf
- letter
-)
+add_custom_target( release_notes )
+set_docbook_target_properties(release_notes)
+add_dependencies ( release_notes release_notes_txt release_notes_html )
-# wsluarm
-ADD_CUSTOM_COMMAND(
- OUTPUT
- wsluarm
- COMMAND cmake -E make_directory wsluarm_src
- COMMAND ${PERL_EXECUTABLE}
- ${CMAKE_CURRENT_SOURCE_DIR}/make-wsluarm.pl
- ${WSLUA_MODULES}
- COMMAND
- touch wsluarm
+add_custom_target(
+ news
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${CMAKE_CURRENT_BINARY_DIR}/release-notes.txt
+ ${CMAKE_SOURCE_DIR}/NEWS
DEPENDS
- ${CMAKE_CURRENT_SOURCE_DIR}/make-wsluarm.pl
- ${WSLUA_MODULES}
+ ${CMAKE_CURRENT_BINARY_DIR}/release-notes.txt
)
+set_docbook_target_properties(news)
+if( ASCIIDOCTOR_FOUND )
+ ASCIIDOCTOR2HTML( release-notes.asciidoc ws.css )
+ ASCIIDOCTOR2TXT( release-notes.asciidoc )
+endif()
+
+#
+# Editor modelines - http://www.wireshark.org/tools/modelines.html
+#
+# Local variables:
+# c-basic-offset: 8
+# tab-width: 8
+# indent-tabs-mode: t
+# End:
+#
+# vi: set shiftwidth=8 tabstop=8 noexpandtab:
+# :indentSize=8:tabSize=8:noTabs=false:
+#