summaryrefslogtreecommitdiffstats
path: root/doc/CMakeLists.txt
blob: 674554fe1fa08ec409cbaf966041a5b780af9a28 (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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# CMakeLists.txt
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <gerald@wireshark.org>
# Copyright 1998 Gerald Combs
#
# SPDX-License-Identifier: GPL-2.0-or-later
#

find_package( Asciidoctor 1.5 )

set(MAN1_SOURCE_FILES)
set(MAN4_SOURCE_FILES)
set(MAN1_INSTALL_FILES)
set(MAN4_INSTALL_FILES)
set(HTML_INSTALL_FILES)

macro (ADD_MAN_PAGE _page_name _man_section)
	if(ASCIIDOCTOR_FOUND)
		list(APPEND HTML_INSTALL_FILES ${CMAKE_CURRENT_BINARY_DIR}/${_page_name}.html)

		if (${_man_section} EQUAL 1)
			list(APPEND MAN1_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${_page_name}.adoc)
			list(APPEND MAN1_INSTALL_FILES ${CMAKE_CURRENT_BINARY_DIR}/${_page_name}.${_man_section})
		elseif (${_man_section} EQUAL 4)
			list(APPEND MAN4_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${_page_name}.adoc)
			list(APPEND MAN4_INSTALL_FILES ${CMAKE_CURRENT_BINARY_DIR}/${_page_name}.${_man_section})
		else()
			message(FATAL_ERROR "Unsupported manual page section ${_man_section} for ${_page_name}")
		endif()
	endif()
endmacro()

ADD_MAN_PAGE(wireshark   1)
ADD_MAN_PAGE(androiddump 1)
ADD_MAN_PAGE(capinfos    1)
ADD_MAN_PAGE(captype     1)
ADD_MAN_PAGE(ciscodump   1)
ADD_MAN_PAGE(dumpcap     1)
ADD_MAN_PAGE(editcap     1)
ADD_MAN_PAGE(mergecap    1)
ADD_MAN_PAGE(randpkt     1)
ADD_MAN_PAGE(randpktdump 1)
ADD_MAN_PAGE(etwdump     1)
ADD_MAN_PAGE(rawshark    1)
ADD_MAN_PAGE(reordercap  1)
ADD_MAN_PAGE(sshdump     1)
ADD_MAN_PAGE(text2pcap   1)
ADD_MAN_PAGE(tshark      1)
ADD_MAN_PAGE(falcodump   1)
ADD_MAN_PAGE(udpdump     1)
ADD_MAN_PAGE(wifidump    1)

ADD_MAN_PAGE(extcap           4)
ADD_MAN_PAGE(wireshark-filter 4)

if(BUILD_dpauxmon AND HAVE_LIBNL3)
	ADD_MAN_PAGE(dpauxmon    1)
endif()

if(BUILD_sdjournal AND SYSTEMD_FOUND)
	ADD_MAN_PAGE(sdjournal   1)
endif()

if(MAXMINDDB_FOUND)
	ADD_MAN_PAGE(mmdbresolve 1)
endif()

if (BUILD_corbaidl2wrs)
	ADD_MAN_PAGE(idl2wrs     1)
endif()

if (BUILD_xxx2deb)
	ADD_MAN_PAGE(asn2deb     1)
	ADD_MAN_PAGE(idl2deb     1)
endif()

set(WIRESHARK_BUNDLE_RESOURCE_SHARE_MAN1_FILES ${MAN1_INSTALL_FILES} PARENT_SCOPE)
set(WIRESHARK_BUNDLE_RESOURCE_SHARE_MAN4_FILES ${MAN4_INSTALL_FILES} PARENT_SCOPE)
# XXX We need a Logray-specific man page list, which might overlap with Wireshark's.
# Just install everything for now.
set(LOGRAY_BUNDLE_RESOURCE_SHARE_MAN1_FILES ${WIRESHARK_BUNDLE_RESOURCE_SHARE_MAN1_FILES} PARENT_SCOPE)
set(LOGRAY_BUNDLE_RESOURCE_SHARE_MAN4_FILES ${WIRESHARK_BUNDLE_RESOURCE_SHARE_MAN4_FILES} PARENT_SCOPE)

set(MAN_INCLUDES diagnostic-options.adoc dissection-options.adoc)

if(ASCIIDOCTOR_FOUND)
	ASCIIDOCTOR2ROFFMAN(1 ${MAN1_SOURCE_FILES})
	ASCIIDOCTOR2ROFFMAN(4 ${MAN4_SOURCE_FILES})
	ASCIIDOCTOR2HTMLMAN(${MAN1_SOURCE_FILES} ${MAN4_SOURCE_FILES})

	add_custom_target(manpages DEPENDS
		${MAN1_INSTALL_FILES}
		${MAN4_INSTALL_FILES}
	)
	set_target_properties(manpages PROPERTIES FOLDER "Documentation")
endif()

if(ASCIIDOCTOR_FOUND)
	ASCIIDOCTOR2HTML(release-notes.adoc)
	ASCIIDOCTOR2TXT(release-notes.adoc)

	list(APPEND HTML_INSTALL_FILES "${CMAKE_CURRENT_BINARY_DIR}/release-notes.html")

	add_custom_target(release_notes_html
		DEPENDS
			${CMAKE_CURRENT_BINARY_DIR}/release-notes.html
	)
	set_target_properties(release_notes_html PROPERTIES FOLDER "Documentation")
	add_custom_target(release_notes_txt
		DEPENDS
			${CMAKE_CURRENT_BINARY_DIR}/release-notes.txt
	)
	set_target_properties(release_notes_txt PROPERTIES FOLDER "Documentation")
	add_custom_target(release_notes
		DEPENDS
			release_notes_html
			release_notes_txt
	)
	set_target_properties(release_notes PROPERTIES FOLDER "Documentation")

	add_custom_target(news
		COMMAND ${CMAKE_COMMAND} -E copy_if_different
			${CMAKE_CURRENT_BINARY_DIR}/release-notes.txt
			${CMAKE_SOURCE_DIR}/NEWS
		DEPENDS
			release_notes_txt
	)
	set_target_properties(news PROPERTIES FOLDER "Documentation")
endif()

add_custom_target(
	docs ALL
	DEPENDS
		${MAN1_INSTALL_FILES}
		${MAN4_INSTALL_FILES}
		${HTML_INSTALL_FILES}
)
set_target_properties(docs PROPERTIES FOLDER "Documentation")

if(ASCIIDOCTOR_FOUND)
	install(
		FILES
			${MAN1_INSTALL_FILES}
		DESTINATION
			${CMAKE_INSTALL_MANDIR}/man1
	)

	install(
		FILES
			${MAN4_INSTALL_FILES}
		DESTINATION
			${CMAKE_INSTALL_MANDIR}/man4
	)
endif()

install(
	FILES
		${HTML_INSTALL_FILES}
	DESTINATION
		${CMAKE_INSTALL_DOCDIR}
)

#
# Editor modelines  -  https://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:
#