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)
12 -DHAVE_HFI_SECTION_INIT
17 ${LIBXML2_DEFINITIONS}
18 ${KERBEROS_DEFINITIONS}
21 add_subdirectory(crypt)
22 add_subdirectory(dfilter)
23 add_subdirectory(dissectors)
24 add_subdirectory(ftypes)
27 add_subdirectory(wslua)
32 COMMAND ${Python3_EXECUTABLE}
33 ${CMAKE_SOURCE_DIR}/tools/rdps.py
34 ${CMAKE_CURRENT_SOURCE_DIR}/print.ps
37 ${CMAKE_SOURCE_DIR}/tools/rdps.py
38 ${CMAKE_CURRENT_SOURCE_DIR}/print.ps
41 set(LIBWIRESHARK_PUBLIC_HEADERS
139 slow_protocol_subtypes.h
168 set(LIBWIRESHARK_HEADER_FILES
169 ${LIBWIRESHARK_PUBLIC_HEADERS}
172 set(LIBWIRESHARK_NONGENERATED_FILES
193 conversation_filter.c
206 frame_data_sequence.c
220 nghttp2_hd_huffman_data.c
276 ${CMAKE_CURRENT_BINARY_DIR}/ps.c
279 set(LIBWIRESHARK_FILES ${LIBWIRESHARK_NONGENERATED_FILES})
281 add_lex_files(LEX_FILES LIBWIRESHARK_FILES
287 protobuf_lang_scanner.l
290 add_lemon_files(LEMON_FILES LIBWIRESHARK_FILES
292 protobuf_lang_parser.lemon
295 set_source_files_properties(
296 ${LIBWIRESHARK_NONGENERATED_FILES}
298 COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
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"
328 set_target_properties(epan PROPERTIES LINK_FLAGS_DEBUG "${WS_MSVC_DEBUG_LINK_FLAGS}")
331 target_link_libraries(epan
342 ${KERBEROS_LIBRARIES}
352 ${WIN_WS2_32_LIBRARY}
356 $<$<BOOL:${LUA_FOUND}>:lrexlib>
359 target_include_directories(epan
361 ${GLIB2_INCLUDE_DIRS}
364 target_include_directories(epan
366 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
367 $<INSTALL_INTERFACE:include/wireshark>
370 target_include_directories(epan
372 ${BROTLI_INCLUDE_DIRS}
373 ${CARES_INCLUDE_DIRS}
374 ${GCRYPT_INCLUDE_DIRS}
375 ${GLIB2_INCLUDE_DIRS}
376 ${GNUTLS_INCLUDE_DIRS}
377 ${LIBXML2_INCLUDE_DIRS}
380 ${NGHTTP2_INCLUDE_DIRS}
381 ${NGHTTP3_INCLUDE_DIRS}
383 ${SNAPPY_INCLUDE_DIRS}
385 ${ZLIBNG_INCLUDE_DIRS}
388 ${CMAKE_CURRENT_BINARY_DIR}
389 ${CMAKE_CURRENT_SOURCE_DIR}
392 add_dependencies(epan lemon)
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"
407 add_executable(exntest EXCLUDE_FROM_ALL exntest.c except.c)
408 target_link_libraries(exntest epan)
409 set_target_properties(exntest PROPERTIES
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
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
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
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
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
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
463 EXCLUDE_FROM_DEFAULT_BUILD True
464 COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
472 ${LIBWIRESHARK_NONGENERATED_FILES}
476 # Editor modelines - https://www.wireshark.org/tools/modelines.html
481 # indent-tabs-mode: t
484 # vi: set shiftwidth=8 tabstop=8 noexpandtab:
485 # :indentSize=8:tabSize=8:noTabs=false: