3 # Wireshark - Network traffic analyzer
4 # By Gerald Combs <gerald@wireshark.org>
5 # Copyright 1998 Gerald Combs
7 # SPDX-License-Identifier: GPL-2.0-or-later
10 set(WIRETAP_PUBLIC_HEADERS
23 # Files that implement reading and possibly writing one or more
24 # file types. (For cases where more than one source file is
25 # used, this should be the one that contains a registration routine.)
27 # This does not include libpcap.c and pcapng.c; those are listed below,
28 # and we don't scan them to see whether they have registration
29 # routines, we *require* them to have registration routines named
30 # register_pcap() and register_pcapng(), and directly call those routines.
32 set(WIRETAP_C_MODULE_FILES
33 ${CMAKE_CURRENT_SOURCE_DIR}/5views.c
34 ${CMAKE_CURRENT_SOURCE_DIR}/aethra.c
35 ${CMAKE_CURRENT_SOURCE_DIR}/ascendtext.c
36 ${CMAKE_CURRENT_SOURCE_DIR}/atm.c
37 ${CMAKE_CURRENT_SOURCE_DIR}/autosar_dlt.c
38 ${CMAKE_CURRENT_SOURCE_DIR}/ber.c
39 ${CMAKE_CURRENT_SOURCE_DIR}/blf.c
40 ${CMAKE_CURRENT_SOURCE_DIR}/btsnoop.c
41 ${CMAKE_CURRENT_SOURCE_DIR}/busmaster.c
42 ${CMAKE_CURRENT_SOURCE_DIR}/camins.c
43 ${CMAKE_CURRENT_SOURCE_DIR}/candump.c
44 ${CMAKE_CURRENT_SOURCE_DIR}/capsa.c
45 ${CMAKE_CURRENT_SOURCE_DIR}/catapult_dct2000.c
46 ${CMAKE_CURRENT_SOURCE_DIR}/cllog.c
47 ${CMAKE_CURRENT_SOURCE_DIR}/commview.c
48 ${CMAKE_CURRENT_SOURCE_DIR}/cosine.c
49 ${CMAKE_CURRENT_SOURCE_DIR}/csids.c
50 ${CMAKE_CURRENT_SOURCE_DIR}/daintree-sna.c
51 ${CMAKE_CURRENT_SOURCE_DIR}/dbs-etherwatch.c
52 ${CMAKE_CURRENT_SOURCE_DIR}/dpa400.c
53 ${CMAKE_CURRENT_SOURCE_DIR}/dct3trace.c
54 ${CMAKE_CURRENT_SOURCE_DIR}/ems.c
55 ${CMAKE_CURRENT_SOURCE_DIR}/etl.c
56 ${CMAKE_CURRENT_SOURCE_DIR}/erf.c
57 ${CMAKE_CURRENT_SOURCE_DIR}/eri_enb_log.c
58 ${CMAKE_CURRENT_SOURCE_DIR}/eyesdn.c
59 ${CMAKE_CURRENT_SOURCE_DIR}/hcidump.c
60 ${CMAKE_CURRENT_SOURCE_DIR}/i4btrace.c
61 ${CMAKE_CURRENT_SOURCE_DIR}/ipfix.c
62 ${CMAKE_CURRENT_SOURCE_DIR}/iptrace.c
63 ${CMAKE_CURRENT_SOURCE_DIR}/iseries.c
64 ${CMAKE_CURRENT_SOURCE_DIR}/json.c
65 ${CMAKE_CURRENT_SOURCE_DIR}/k12.c
66 ${CMAKE_CURRENT_SOURCE_DIR}/lanalyzer.c
67 ${CMAKE_CURRENT_SOURCE_DIR}/log3gpp.c
68 ${CMAKE_CURRENT_SOURCE_DIR}/logcat.c
69 ${CMAKE_CURRENT_SOURCE_DIR}/logcat_text.c
70 ${CMAKE_CURRENT_SOURCE_DIR}/mp4.c
71 ${CMAKE_CURRENT_SOURCE_DIR}/mpeg.c
72 ${CMAKE_CURRENT_SOURCE_DIR}/mplog.c
73 ${CMAKE_CURRENT_SOURCE_DIR}/mime_file.c
74 ${CMAKE_CURRENT_SOURCE_DIR}/mp2t.c
75 ${CMAKE_CURRENT_SOURCE_DIR}/netmon.c
76 ${CMAKE_CURRENT_SOURCE_DIR}/netscaler.c
77 ${CMAKE_CURRENT_SOURCE_DIR}/netscreen.c
78 ${CMAKE_CURRENT_SOURCE_DIR}/nettl.c
79 ${CMAKE_CURRENT_SOURCE_DIR}/nettrace_3gpp_32_423.c
80 ${CMAKE_CURRENT_SOURCE_DIR}/netxray.c
81 ${CMAKE_CURRENT_SOURCE_DIR}/ngsniffer.c
82 ${CMAKE_CURRENT_SOURCE_DIR}/observer.c
83 ${CMAKE_CURRENT_SOURCE_DIR}/packetlogger.c
84 ${CMAKE_CURRENT_SOURCE_DIR}/pcap-common.c
85 ${CMAKE_CURRENT_SOURCE_DIR}/peekclassic.c
86 ${CMAKE_CURRENT_SOURCE_DIR}/peektagged.c
87 ${CMAKE_CURRENT_SOURCE_DIR}/pppdump.c
88 ${CMAKE_CURRENT_SOURCE_DIR}/radcom.c
89 ${CMAKE_CURRENT_SOURCE_DIR}/rfc7468.c
90 ${CMAKE_CURRENT_SOURCE_DIR}/rtpdump.c
91 ${CMAKE_CURRENT_SOURCE_DIR}/ruby_marshal.c
92 ${CMAKE_CURRENT_SOURCE_DIR}/snoop.c
93 ${CMAKE_CURRENT_SOURCE_DIR}/stanag4607.c
94 ${CMAKE_CURRENT_SOURCE_DIR}/systemd_journal.c
95 ${CMAKE_CURRENT_SOURCE_DIR}/tnef.c
96 ${CMAKE_CURRENT_SOURCE_DIR}/toshiba.c
97 ${CMAKE_CURRENT_SOURCE_DIR}/visual.c
98 ${CMAKE_CURRENT_SOURCE_DIR}/vms.c
99 ${CMAKE_CURRENT_SOURCE_DIR}/vwr.c
102 set(WIRETAP_LEX_MODULE_FILES
103 ${CMAKE_CURRENT_SOURCE_DIR}/k12text.l
107 # Files to scan for registration routines.
109 set(WIRETAP_MODULE_FILES
110 ${WIRETAP_C_MODULE_FILES}
111 ${WIRETAP_LEX_MODULE_FILES}
115 # C source files that aren't generated.
117 set(WIRETAP_NONGENERATED_C_FILES
118 ${WIRETAP_C_MODULE_FILES}
119 ${CMAKE_CURRENT_SOURCE_DIR}/pcapng.c
120 ${CMAKE_CURRENT_SOURCE_DIR}/introspection.c
121 ${CMAKE_CURRENT_SOURCE_DIR}/libpcap.c
122 ${CMAKE_CURRENT_SOURCE_DIR}/file_access.c
123 ${CMAKE_CURRENT_SOURCE_DIR}/file_wrappers.c
124 ${CMAKE_CURRENT_SOURCE_DIR}/merge.c
125 ${CMAKE_CURRENT_SOURCE_DIR}/secrets-types.c
126 ${CMAKE_CURRENT_SOURCE_DIR}/wtap.c
127 ${CMAKE_CURRENT_SOURCE_DIR}/wtap_opttypes.c
131 # All C files to compile.
133 set(WIRETAP_FILES ${WIRETAP_NONGENERATED_C_FILES} wtap_modules.c)
135 add_lex_files(LEX_FILES WIRETAP_FILES
136 ${WIRETAP_LEX_MODULE_FILES}
137 ${CMAKE_CURRENT_SOURCE_DIR}/ascend_scanner.l
138 ${CMAKE_CURRENT_SOURCE_DIR}/busmaster_scanner.l
139 ${CMAKE_CURRENT_SOURCE_DIR}/candump_scanner.l
142 add_lemon_files(LEMON_FILES WIRETAP_FILES
143 ${CMAKE_CURRENT_SOURCE_DIR}/ascend_parser.lemon
144 ${CMAKE_CURRENT_SOURCE_DIR}/busmaster_parser.lemon
145 ${CMAKE_CURRENT_SOURCE_DIR}/candump_parser.lemon
149 # We pass the arguments to make-regs.py in a file to avoid limitations
150 # with the number of arguments handled by main().
153 OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/wtap_modules.in.txt"
154 CONTENT "$<JOIN:${WIRETAP_MODULE_FILES},\n>\n"
157 OUTPUT wtap_modules.c
158 COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/make-regs.py wtap_modules wtap_modules.c @wtap_modules.in.txt
159 DEPENDS ${CMAKE_SOURCE_DIR}/tools/make-regs.py ${WIRETAP_MODULE_FILES}
160 "${CMAKE_CURRENT_BINARY_DIR}/wtap_modules.in.txt"
161 COMMENT "Making wtap_modules.c"
165 # All files are warning-clean. (Let's keep it that way.)
167 set_source_files_properties(
168 ${WIRETAP_NONGENERATED_C_FILES}
170 COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
175 ${CMAKE_BINARY_DIR}/resources/libwiretap.rc
178 set_target_properties(wiretap PROPERTIES
180 COMPILE_DEFINITIONS "WS_BUILD_DLL"
181 LINK_FLAGS "${WS_LINK_FLAGS}"
182 VERSION "0.0.0" SOVERSION 0
184 INSTALL_RPATH "${LIBRARY_INSTALL_RPATH}"
187 set_target_properties(wiretap PROPERTIES LINK_FLAGS_DEBUG "${WS_MSVC_DEBUG_LINK_FLAGS}")
190 target_link_libraries(wiretap
201 target_include_directories(wiretap SYSTEM
204 ${ZLIBNG_INCLUDE_DIRS}
209 target_include_directories(wiretap PUBLIC
210 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
213 install(TARGETS wiretap
214 EXPORT WiresharkTargets
215 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
216 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
217 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
220 install(FILES ${WIRETAP_PUBLIC_HEADERS}
221 DESTINATION "${PROJECT_INSTALL_INCLUDEDIR}/wiretap"
222 COMPONENT "Development"
231 ${WIRETAP_NONGENERATED_FILES}
232 # LEX files commented out due to use of malloc, free etc.
238 # Editor modelines - https://www.wireshark.org/tools/modelines.html
243 # indent-tabs-mode: t
246 # vi: set shiftwidth=8 tabstop=8 noexpandtab:
247 # :indentSize=8:tabSize=8:noTabs=false: