wireshark-dev-3.4.7-1~exp1 from Ubuntu 21.10 includes the file /usr/lib/x86_64-linux-gnu/wireshark/cmake/WiresharkTargets.cmake. I don't really understand what's the difference between wireshark-dev and libwireshark-dev. cmake/WiresharkConfig.cmake and pkgconfig/wireshark.pc have basically the same function, but they are in different packages? But in any case, WiresharkTargets.cmake says:
add_library(wsutil SHARED IMPORTED)
set_target_properties(wsutil PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "/usr/include;/usr/include"
INTERFACE_LINK_LIBRARIES "dl;/usr/lib/x86_64-linux-gnu/libgmodule-2.0.so;/usr/lib/x86_64-linux-gnu/libglib-2.0.so;/usr/lib/x86_64-linux-gnu/libgcrypt.so;/usr/lib/x86_64-linux-gnu/libgpg-error.so;/usr/lib/x86_64-linux-gnu/libgnutls.so;m"
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "/usr/include;/usr/include"
)
But wireshark-dev doesn't depend on anything providing /usr/lib/x86_64-linux-gnu/libgcrypt.so or /usr/lib/x86_64-linux-gnu/libgnutls.so. I had to manually install libgnutls28-dev and libgcrypt20-dev to build my Wireshark dissector with a cmake build system (the epan target depends on the wsutil target).
Probably WiresharkTargets.cmake is wrong, the dependency doesn't really exist, but as long as it says it's there the package metadata should probably have it too.
FWIW the Fedora 35 Wireshark 3.6.1 package says the more correct
# Create imported target wsutil library( wsutil SHARED IMPORTED)
add_
set_ target_ properties( wsutil PROPERTIES _LINK_LIBRARIES "/usr/lib64/ libglib- 2.0.so; /usr/lib64/ libgmodule- 2.0.so"
INTERFACE
)
instead of what the Ubuntu 21.10 Wireshark 3.4.7 package says
# Create imported target wsutil library( wsutil SHARED IMPORTED)
add_
set_ target_ properties( wsutil PROPERTIES _INCLUDE_ DIRECTORIES "/usr/include; /usr/include" _LINK_LIBRARIES "dl;/usr/ lib/x86_ 64-linux- gnu/libgmodule- 2.0.so; /usr/lib/ x86_64- linux-gnu/ libglib- 2.0.so; /usr/lib/ x86_64- linux-gnu/ libgcrypt. so;/usr/ lib/x86_ 64-linux- gnu/libgpg- error.so; /usr/lib/ x86_64- linux-gnu/ libgnutls. so;m" _SYSTEM_ INCLUDE_ DIRECTORIES "/usr/include; /usr/include"
INTERFACE
INTERFACE
INTERFACE
)
I have not checked where the difference comes from (wireshark version, cmake version or something else).