epan/dissectors/packet-dcerpc.* move ndr_pointer stuff to dcerpc_info and avoid globa...
[metze/wireshark/wip.git] / CMakeLists.txt
index 665c4af2c15964fb5572ecef04f9e67b16a0f1f0..dd9b78c395404a1596fc290af6a474b1cad00dc9 100644 (file)
@@ -59,22 +59,6 @@ set(PROJECT_MAJOR_VERSION 4)
 set(PROJECT_MINOR_VERSION 3)
 set(PROJECT_PATCH_VERSION 0)
 set(PROJECT_BUILD_VERSION 0)
-# ABI version for plugins. It must be incremented by one for
-# every odd minor release number.
-# start at 1 (arbitrary).
-# release 4.3.X (unstable) = ABI version 1 (start)
-# release 4.4.X (stable)   = ABI version 1 (stable release, freeze ABI 1)
-# release 4.5.X (unstable) = ABI version 2 (increment for new unstable release, ABI break)
-# release 4.6.X (stable)   = ABI version 2 (stable release, freeze ABI 2)
-# release 4.7.X (unstable) = ABI version 3 (increment for new unstable release, ABI break)
-# release 5.0.X (stable)   = ABI version 3 (stable release, freeze ABI 3)
-# etc.
-set(PROJECT_ABI_VERSION_EPAN    1)
-set(PROJECT_ABI_VERSION_WIRETAP 1)
-# Codecs API/ABI is much more narrow and stable than the other two so this
-# may not need to be incremented every X.Y release.
-set(PROJECT_ABI_VERSION_CODEC   1)
-
 set(PROJECT_VERSION_EXTENSION "")
 
 if(DEFINED ENV{WIRESHARK_VERSION_EXTRA})
@@ -1211,6 +1195,10 @@ find_package(GCRYPT "1.8.0" REQUIRED)
 # C Asynchronous resolver
 reset_find_package(CARES)
 find_package(CARES "1.13.0" REQUIRED)
+if (CARES_VERSION VERSION_GREATER_EQUAL "1.28.0")
+       # Suppress deprecation warnings.
+       add_compile_definitions(CARES_NO_DEPRECATED)
+endif ()
 find_package(LEX REQUIRED)
 find_package(Perl)
 find_package(PCRE2 REQUIRED)
@@ -1384,9 +1372,9 @@ ws_find_package(NGHTTP3 ENABLE_NGHTTP3 HAVE_NGHTTP3)
 # Embedded Lua interpreter
 if(FETCH_lua)
        # Download and build lua
-       include(${CMAKE_SOURCE_DIR}/cmake/external/lua52/Lua52.cmake)
+       include(${CMAKE_SOURCE_DIR}/cmake/external/lua53/Lua53.cmake)
 else()
-       set(LUA_FIND_VERSIONS "5.4;5.3;5.2;5.1" CACHE STRING "Lua versions valid for the build (as a list)")
+       set(LUA_FIND_VERSIONS "5.4;5.3" CACHE STRING "Lua versions valid for the build (as a list)")
        ws_find_package(Lua ENABLE_LUA HAVE_LUA)
 endif()
 
@@ -1616,6 +1604,24 @@ else()
        endif()
 endif()
 
+if(APPLE)
+       #
+       # As https://developer.apple.com/library/archive/technotes/tn2206/_index.html
+       # says,
+       #
+       # "Note that a location where code is expected to reside cannot generally
+       # contain directories full of nested code, because those directories tend
+       # to be interpreted as bundles. So this occasional practice is not
+       # recommended and not officially supported. If you do do this, do not use
+       # periods in the directory names. The code signing machinery interprets
+       # directories with periods in their names as code bundles and will reject
+       # them if they don't conform to the expected code bundle layout."
+       #
+       set(PLUGIN_PATH_ID "${PROJECT_MAJOR_VERSION}-${PROJECT_MINOR_VERSION}")
+else()
+       set(PLUGIN_PATH_ID "${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}")
+endif()
+
 # Directory where plugins and Lua dissectors can be found.
 if(WIN32 AND NOT USE_MSYSTEM)
        set(PLUGIN_INSTALL_LIBDIR "plugins" CACHE INTERNAL "The plugin dir")
@@ -1623,6 +1629,8 @@ else()
        set(PLUGIN_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/plugins" CACHE INTERNAL "The plugin dir")
 endif()
 set(PLUGIN_INSTALL_FULL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${PLUGIN_INSTALL_LIBDIR}")
+set(PLUGIN_INSTALL_VERSION_LIBDIR "${PLUGIN_INSTALL_LIBDIR}/${PLUGIN_PATH_ID}")
+set(PLUGIN_VERSION_DIR "plugins/${PLUGIN_PATH_ID}")
 
 add_subdirectory( capture )
 add_subdirectory( doc )
@@ -1719,7 +1727,7 @@ if(ENABLE_PLUGINS)
                plugins/epan/wimaxmacphy
                plugins/epan/dfilter/ipaddr
                plugins/wiretap/usbdump
-               plugins/codecs/g711
+               plugins/codecs/G711
                plugins/codecs/l16_mono
                ${CUSTOM_PLUGIN_SRC_DIR}
        )
@@ -1731,13 +1739,13 @@ if(ENABLE_PLUGINS)
        endif()
        if(SPANDSP_FOUND)
                list(APPEND PLUGIN_SRC_DIRS
-                       plugins/codecs/g722
-                       plugins/codecs/g726
+                       plugins/codecs/G722
+                       plugins/codecs/G726
                )
        endif()
        if(BCG729_FOUND)
                list(APPEND PLUGIN_SRC_DIRS
-                       plugins/codecs/g729
+                       plugins/codecs/G729
                )
        endif()
        if(AMRNB_FOUND)
@@ -1747,7 +1755,7 @@ if(ENABLE_PLUGINS)
        endif()
        if(ILBC_FOUND)
                list(APPEND PLUGIN_SRC_DIRS
-                       plugins/codecs/ilbc
+                       plugins/codecs/iLBC
                )
        endif()
        if(OPUS_FOUND)
@@ -1775,22 +1783,22 @@ endif()
 
 if(ENABLE_APPLICATION_BUNDLE)
        if(CMAKE_CFG_INTDIR STREQUAL ".")
-               set(_plugin_dir "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark")
+               set(_plugin_dir "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark/${PLUGIN_PATH_ID}")
        else()
                # Xcode
-               set(_plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/Wireshark.app/Contents/PlugIns/wireshark")
+               set(_plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/Wireshark.app/Contents/PlugIns/wireshark/${PLUGIN_PATH_ID}")
        endif()
        if(CMAKE_CFG_INTDIR STREQUAL ".")
-               set(_logray_plugin_dir "${CMAKE_BINARY_DIR}/run/Logray.app/Contents/PlugIns/logray")
+               set(_logray_plugin_dir "${CMAKE_BINARY_DIR}/run/Logray.app/Contents/PlugIns/logray/${PLUGIN_PATH_ID}")
        else()
                # Xcode
-               set(_logray_plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/Logray.app/Contents/PlugIns/logray")
+               set(_logray_plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/Logray.app/Contents/PlugIns/logray/${PLUGIN_PATH_ID}")
        endif()
 elseif(MSVC AND NOT CMAKE_CFG_INTDIR STREQUAL ".")
-       set(_plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/plugins")
+       set(_plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/${PLUGIN_VERSION_DIR}")
        set(_logray_plugin_dir ${_plugin_dir})
 else()
-       set(_plugin_dir "${DATAFILE_DIR}/plugins")
+       set(_plugin_dir "${DATAFILE_DIR}/${PLUGIN_VERSION_DIR}")
        set(_logray_plugin_dir ${_plugin_dir})
 endif()
 set (PLUGIN_DIR ${_plugin_dir} CACHE INTERNAL "Build time plugin location.")
@@ -1911,7 +1919,7 @@ set_package_properties(LZ4 PROPERTIES
 set_package_properties(SNAPPY PROPERTIES
        DESCRIPTION "A fast compressor/decompressor from Google"
        URL "https://google.github.io/snappy/"
-       PURPOSE "Snappy decompression in CQL and Kafka dissectors"
+       PURPOSE "Snappy decompression in Couchbase, CQL, Kafka and Mongo dissectors"
 )
 set_package_properties(ZSTD PROPERTIES
        DESCRIPTION "A compressor/decompressor from Facebook providing better compression than Snappy at a cost of speed"
@@ -1995,9 +2003,6 @@ if(WIN32)
        set(PLATFORM_UI_SRC
                ui/win32/file_dlg_win32.cpp
        )
-       set(PLATFORM_UI_RC_FILES
-               resources/file_dlg_win32.rc
-       )
 elseif(APPLE)
        set(PLATFORM_UI_SRC
                ui/macosx/cocoa_bridge.mm
@@ -3014,7 +3019,6 @@ if(BUILD_tshark)
                ${APPLE_CORE_FOUNDATION_LIBRARY}
                ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
                ${WIN_WS2_32_LIBRARY}
-               ${M_LIBRARIES}
        )
        set(tshark_FILES
                $<TARGET_OBJECTS:capture_opts>
@@ -3088,7 +3092,6 @@ if(BUILD_sharkd)
                ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
                ${WIN_WS2_32_LIBRARY}
                ${SPEEXDSP_LIBRARIES}
-               ${M_LIBRARIES}
                ${GCRYPT_LIBRARIES}
        )
        set(sharkd_FILES
@@ -3284,7 +3287,6 @@ if(BUILD_dumpcap AND PCAP_FOUND)
                ${APPLE_CORE_FOUNDATION_LIBRARY}
                ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
                ${WIN_WS2_32_LIBRARY}
-               ${M_LIBRARIES}
        )
        if(UNIX)
                list(APPEND CAPUTILS_SRC
@@ -4128,7 +4130,7 @@ configure_package_config_file(WiresharkConfig.cmake.in
        PATH_VARS
                CMAKE_INSTALL_LIBDIR
                CMAKE_INSTALL_INCLUDEDIR
-               PLUGIN_INSTALL_LIBDIR
+               PLUGIN_INSTALL_VERSION_LIBDIR
                EXTCAP_INSTALL_LIBDIR
 )