drsuapi_SupportedExtensionsExt
[wireshark-sm.git] / epan / CMakeLists.txt
blob850df4440000ed935fe441d53efb553fcc866a68
1 # CMakeLists.txt
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 if (HAVE_HFI_SECTION_INIT)
11         add_definitions(
12                 -DHAVE_HFI_SECTION_INIT
13         )
14 endif()
16 add_definitions(
17                 ${LIBXML2_DEFINITIONS}
18                 ${KERBEROS_DEFINITIONS}
21 add_subdirectory(crypt)
22 add_subdirectory(dfilter)
23 add_subdirectory(dissectors)
24 add_subdirectory(ftypes)
26 if(LUA_FOUND)
27         add_subdirectory(wslua)
28 endif()
30 add_custom_command(
31         OUTPUT ps.c
32         COMMAND ${Python3_EXECUTABLE}
33                 ${CMAKE_SOURCE_DIR}/tools/rdps.py
34                 ${CMAKE_CURRENT_SOURCE_DIR}/print.ps
35                 ps.c
36         DEPENDS
37                 ${CMAKE_SOURCE_DIR}/tools/rdps.py
38                 ${CMAKE_CURRENT_SOURCE_DIR}/print.ps
41 set(LIBWIRESHARK_PUBLIC_HEADERS
42         addr_resolv.h
43         address.h
44         address_types.h
45         afn.h
46         aftypes.h
47         app_mem_usage.h
48         arcnet_pids.h
49         arptypes.h
50         asn1.h
51         ax25_pids.h
52         bridged_pids.h
53         capture_dissectors.h
54         charsets.h
55         chdlctypes.h
56         cisco_pid.h
57         color_filters.h
58         column.h
59         column-info.h
60         column-utils.h
61         conversation.h
62         conversation_debug.h
63         conversation_table.h
64         conv_id.h
65         crc10-tvb.h
66         crc16-tvb.h
67         crc32-tvb.h
68         crc6-tvb.h
69         crc8-tvb.h
70         decode_as.h
71         diam_dict.h
72         disabled_protos.h
73         conversation_filter.h
74         dccpservicecodes.h
75         dtd.h
76         dtd_parse.h
77         dvb_chartbl.h
78         eap.h
79         eapol_keydes_types.h
80         epan.h
81         epan_dissect.h
82         etypes.h
83         ex-opt.h
84         except.h
85         exceptions.h
86         expert.h
87         export_object.h
88         exported_pdu.h
89         fifo_string_cache.h
90         filter_expressions.h
91         follow.h
92         frame_data.h
93         frame_data_sequence.h
94         funnel.h
95         #geoip_db.h
96         golay.h
97         guid-utils.h
98         iana_charsets.h
99         iax2_codec_type.h
100         in_cksum.h
101         introspection.h
102         iana-ip.h
103         ip_opts.h
104         ipproto.h
105         lapd_sapi.h
106         llcsaps.h
107         maxmind_db.h
108         media_params.h
109         next_tvb.h
110         nghttp2_hd_huffman.h
111         nlpid.h
112         oids.h
113         osi-utils.h
114         oui.h
115         packet.h
116         packet_info.h
117         params.h
118         pci-ids.h
119         plugin_if.h
120         ppptypes.h
121         print.h
122         print_stream.h
123         prefs.h
124         prefs-int.h
125         proto.h
126         proto_data.h
127         ps.h
128         ptvcursor.h
129         range.h
130         reassemble.h
131         reedsolomon.h
132         register.h
133         req_resp_hdrs.h
134         rtd_table.h
135         rtp_pt.h
136         sctpppids.h
137         secrets.h
138         show_exception.h
139         slow_protocol_subtypes.h
140         sminmpec.h
141         srt_table.h
142         stat_tap_ui.h
143         stat_groups.h
144         stats_tree.h
145         stats_tree_priv.h
146         stream.h
147         strutil.h
148         t35.h
149         tap.h
150         tap-voip.h
151         timestamp.h
152         timestats.h
153         tfs.h
154         to_str.h
155         tvbparse.h
156         tvbuff.h
157         tvbuff-int.h
158         uat.h
159         uat-int.h
160         unit_strings.h
161         value_string.h
162         wmem_scopes.h
163         wscbor.h
164         x264_prt_id.h
165         xdlc.h
168 set(LIBWIRESHARK_HEADER_FILES
169         ${LIBWIRESHARK_PUBLIC_HEADERS}
172 set(LIBWIRESHARK_NONGENERATED_FILES
173         addr_resolv.c
174         address_types.c
175         afn.c
176         aftypes.c
177         app_mem_usage.c
178         asn1.c
179         capture_dissectors.c
180         charsets.c
181         color_filters.c
182         column.c
183         column-utils.c
184         conversation.c
185         conversation_table.c
186         crc10-tvb.c
187         crc16-tvb.c
188         crc32-tvb.c
189         crc6-tvb.c
190         crc8-tvb.c
191         decode_as.c
192         disabled_protos.c
193         conversation_filter.c
194         dvb_chartbl.c
195         enterprises.c
196         epan.c
197         ex-opt.c
198         except.c
199         expert.c
200         export_object.c
201         exported_pdu.c
202         fifo_string_cache.c
203         filter_expressions.c
204         follow.c
205         frame_data.c
206         frame_data_sequence.c
207         funnel.c
208         #geoip_db.c
209         golay.c
210         guid-utils.c
211         iana_charsets.c
212         iana-ip.c
213         in_cksum.c
214         introspection.c
215         ipproto.c
216         manuf.c
217         maxmind_db.c
218         media_params.c
219         next_tvb.c
220         nghttp2_hd_huffman_data.c
221         oids.c
222         osi-utils.c
223         packet.c
224         pci-ids.c
225         plugin_if.c
226         print.c
227         print_stream.c
228         prefs.c
229         proto.c
230         proto_data.c
231         range.c
232         reassemble.c
233         reedsolomon.c
234         register.c
235         req_resp_hdrs.c
236         rtd_table.c
237         sctpppids.c
238         secrets.c
239         sequence_analysis.c
240         services.c
241         show_exception.c
242         srt_table.c
243         stat_tap_ui.c
244         stats_tree.c
245         strutil.c
246         stream.c
247         t35.c
248         tap.c
249         timestamp.c
250         timestats.c
251         tfs.c
252         to_str.c
253         tvbparse.c
254         tvbuff.c
255         tvbuff_base64.c
256         tvbuff_brotli.c
257         tvbuff_snappy.c
258         tvbuff_composite.c
259         tvbuff_hpackhuff.c
260         tvbuff_real.c
261         tvbuff_subset.c
262         tvbuff_zlib.c
263         tvbuff_zstd.c
264         tvbuff_lz77.c
265         tvbuff_lz77huff.c
266         tvbuff_lznt1.c
267         tvbuff_rdp.c
268         uat.c
269         value_string.c
270         wscbor.c
271         unit_strings.c
272         wmem_scopes.c
273         xdlc.c
274         protobuf-helper.c
275         protobuf_lang_tree.c
276         ${CMAKE_CURRENT_BINARY_DIR}/ps.c
279 set(LIBWIRESHARK_FILES ${LIBWIRESHARK_NONGENERATED_FILES})
281 add_lex_files(LEX_FILES LIBWIRESHARK_FILES
282         diam_dict.l
283         dtd_parse.l
284         dtd_preparse.l
285         radius_dict.l
286         uat_load.l
287         protobuf_lang_scanner.l
290 add_lemon_files(LEMON_FILES LIBWIRESHARK_FILES
291         dtd_grammar.lemon
292         protobuf_lang_parser.lemon
295 set_source_files_properties(
296         ${LIBWIRESHARK_NONGENERATED_FILES}
297         PROPERTIES
298         COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
301 add_library(epan
302         #Included so that Visual Studio can properly put header files in solution
303         ${LIBWIRESHARK_HEADER_FILES}
305         ${LIBWIRESHARK_FILES}
306         $<TARGET_OBJECTS:crypt>
307         $<TARGET_OBJECTS:dfilter>
308         $<TARGET_OBJECTS:dissectors>
309         $<TARGET_OBJECTS:dissectors-corba>
310         $<TARGET_OBJECTS:dissector-registration>
311         $<TARGET_OBJECTS:ftypes>
312         $<$<BOOL:${LUA_FOUND}>:$<TARGET_OBJECTS:wslua>>
313         ${CMAKE_BINARY_DIR}/resources/libwireshark.rc
316 set_target_properties(epan PROPERTIES
317         COMPILE_DEFINITIONS "WS_BUILD_DLL"
318         LINK_FLAGS "${WS_LINK_FLAGS}"
319         VERSION "0.0.0" SOVERSION 0
320         INSTALL_RPATH "${LIBRARY_INSTALL_RPATH}"
321         # By default the name for a library with target name epan will be libepan,
322         # but Ethereal is now named Wireshark
323         OUTPUT_NAME "wireshark"
324         PREFIX "lib"
325         FOLDER "DLLs"
327 if(MSVC)
328         set_target_properties(epan PROPERTIES LINK_FLAGS_DEBUG "${WS_MSVC_DEBUG_LINK_FLAGS}")
329 endif()
331 target_link_libraries(epan
332         PUBLIC
333                 wsutil
334                 ${GLIB2_LIBRARIES}
335         PRIVATE
336                 wiretap
337                 ${BROTLI_LIBRARIES}
338                 ${CARES_LIBRARIES}
339                 ${GCRYPT_LIBRARIES}
340                 ${GIO2_LIBRARIES}
341                 ${GNUTLS_LIBRARIES}
342                 ${KERBEROS_LIBRARIES}
343                 ${LIBXML2_LIBRARIES}
344                 ${LUA_LIBRARIES}
345                 ${LZ4_LIBRARIES}
346                 ${M_LIBRARIES}
347                 ${NGHTTP2_LIBRARIES}
348                 ${NGHTTP3_LIBRARIES}
349                 ${SMI_LIBRARIES}
350                 ${SNAPPY_LIBRARIES}
351                 ${WIN_PSAPI_LIBRARY}
352                 ${WIN_WS2_32_LIBRARY}
353                 ${ZLIB_LIBRARIES}
354                 ${ZLIBNG_LIBRARIES}
355                 ${ZSTD_LIBRARIES}
356                 $<$<BOOL:${LUA_FOUND}>:lrexlib>
359 target_include_directories(epan
360         SYSTEM PUBLIC
361                 ${GLIB2_INCLUDE_DIRS}
364 target_include_directories(epan
365         INTERFACE
366                 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
367                 $<INSTALL_INTERFACE:include/wireshark>
370 target_include_directories(epan
371         SYSTEM PRIVATE
372                 ${BROTLI_INCLUDE_DIRS}
373                 ${CARES_INCLUDE_DIRS}
374                 ${GCRYPT_INCLUDE_DIRS}
375                 ${GLIB2_INCLUDE_DIRS}
376                 ${GNUTLS_INCLUDE_DIRS}
377                 ${LIBXML2_INCLUDE_DIRS}
378                 ${LUA_INCLUDE_DIRS}
379                 ${LZ4_INCLUDE_DIRS}
380                 ${NGHTTP2_INCLUDE_DIRS}
381                 ${NGHTTP3_INCLUDE_DIRS}
382                 ${SMI_INCLUDE_DIRS}
383                 ${SNAPPY_INCLUDE_DIRS}
384                 ${ZLIB_INCLUDE_DIRS}
385                 ${ZLIBNG_INCLUDE_DIRS}
386                 ${ZSTD_INCLUDE_DIRS}
387         PRIVATE
388                 ${CMAKE_CURRENT_BINARY_DIR}
389                 ${CMAKE_CURRENT_SOURCE_DIR}
392 add_dependencies(epan lemon)
394 install(TARGETS epan
395         EXPORT WiresharkTargets
396         RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
397         LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
398         ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
401 install(FILES ${LIBWIRESHARK_PUBLIC_HEADERS}
402         DESTINATION "${PROJECT_INSTALL_INCLUDEDIR}/epan"
403         COMPONENT "Development"
404         EXCLUDE_FROM_ALL
407 add_executable(exntest EXCLUDE_FROM_ALL exntest.c except.c)
408 target_link_libraries(exntest epan)
409 set_target_properties(exntest PROPERTIES
410         FOLDER "Tests"
411         EXCLUDE_FROM_DEFAULT_BUILD True
412         COMPILE_DEFINITIONS "WS_BUILD_DLL"
413         COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
416 add_executable(fifo_string_cache_test EXCLUDE_FROM_ALL fifo_string_cache_test.c)
417 target_link_libraries(fifo_string_cache_test epan)
418 set_target_properties(fifo_string_cache_test PROPERTIES
419         FOLDER "Tests"
420         EXCLUDE_FROM_DEFAULT_BUILD True
421         COMPILE_DEFINITIONS "WS_BUILD_DLL"
422         COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
425 add_executable(oids_test EXCLUDE_FROM_ALL oids_test.c)
426 target_link_libraries(oids_test epan)
427 set_target_properties(oids_test PROPERTIES
428         FOLDER "Tests"
429         EXCLUDE_FROM_DEFAULT_BUILD True
430         COMPILE_DEFINITIONS "WS_BUILD_DLL"
431         COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
434 add_executable(reassemble_test EXCLUDE_FROM_ALL reassemble_test.c)
435 target_link_libraries(reassemble_test epan)
436 set_target_properties(reassemble_test PROPERTIES
437         FOLDER "Tests"
438         EXCLUDE_FROM_DEFAULT_BUILD True
439         COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
442 add_executable(tvbtest EXCLUDE_FROM_ALL tvbtest.c)
443 target_link_libraries(tvbtest epan)
444 set_target_properties(tvbtest PROPERTIES
445         FOLDER "Tests"
446         EXCLUDE_FROM_DEFAULT_BUILD True
447         COMPILE_DEFINITIONS "WS_BUILD_DLL"
448         COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
451 add_executable(wscbor_test EXCLUDE_FROM_ALL wscbor_test.c)
452 target_link_libraries(wscbor_test epan)
453 set_target_properties(wscbor_test PROPERTIES
454     FOLDER "Tests"
455     EXCLUDE_FROM_DEFAULT_BUILD True
456     COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
459 add_executable(test_epan EXCLUDE_FROM_ALL test_epan.c)
460 target_link_libraries(test_epan epan)
461 set_target_properties(test_epan PROPERTIES
462         FOLDER "Tests"
463         EXCLUDE_FROM_DEFAULT_BUILD True
464         COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
467 CHECKAPI(
468         NAME
469           epan
470         SWITCHES
471         SOURCES
472           ${LIBWIRESHARK_NONGENERATED_FILES}
476 # Editor modelines  -  https://www.wireshark.org/tools/modelines.html
478 # Local variables:
479 # c-basic-offset: 8
480 # tab-width: 8
481 # indent-tabs-mode: t
482 # End:
484 # vi: set shiftwidth=8 tabstop=8 noexpandtab:
485 # :indentSize=8:tabSize=8:noTabs=false: