diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
commit | e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch) | |
tree | 68cb5ef9081156392f1dd62a00c6ccc1451b93df /cmake/modules/FindNGHTTP3.cmake | |
parent | Initial commit. (diff) | |
download | wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip |
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/modules/FindNGHTTP3.cmake')
-rw-r--r-- | cmake/modules/FindNGHTTP3.cmake | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/cmake/modules/FindNGHTTP3.cmake b/cmake/modules/FindNGHTTP3.cmake new file mode 100644 index 0000000..9ec5404 --- /dev/null +++ b/cmake/modules/FindNGHTTP3.cmake @@ -0,0 +1,62 @@ +# Find the system's Nghttp3 includes and library +# +# NGHTTP3_INCLUDE_DIRS - where to find nghttp3.h +# NGHTTP3_LIBRARIES - List of libraries when using nghttp3 +# NGHTTP3_FOUND - True if nghttp3 found +# NGHTTP3_DLL_DIR - (Windows) Path to the Nghttp2 DLL +# NGHTTP3_DLL - (Windows) Name of the Nghttp2 DLL + +include( FindWSWinLibs ) +FindWSWinLibs( "nghttp3-.*" "NGHTTP3_HINTS" ) + +if( NOT WIN32) + find_package(PkgConfig) + pkg_search_module(NGHTTP3 libnghttp3) +endif() + +find_path( NGHTTP3_INCLUDE_DIR + NAMES nghttp3/nghttp3.h + HINTS + "${NGHTTP3_INCLUDEDIR}" + "${NGHTTP3_HINTS}/include" + PATHS /usr/local/include /usr/include +) + +find_library( NGHTTP3_LIBRARY + NAMES nghttp3 + HINTS + "${NGHTTP3_LIBDIR}" + "${NGHTTP3_HINTS}/lib" + PATHS /usr/local/lib /usr/lib +) + +include( FindPackageHandleStandardArgs ) +find_package_handle_standard_args( NGHTTP3 DEFAULT_MSG NGHTTP3_LIBRARY NGHTTP3_INCLUDE_DIR ) + +if( NGHTTP3_FOUND ) + set( NGHTTP3_INCLUDE_DIRS ${NGHTTP3_INCLUDE_DIR} ) + set( NGHTTP3_LIBRARIES ${NGHTTP3_LIBRARY} ) + if (WIN32) + set ( NGHTTP3_DLL_DIR "${NGHTTP3_HINTS}/bin" + CACHE PATH "Path to nghttp3 DLL" + ) + file( GLOB _nghttp3_dll RELATIVE "${NGHTTP3_DLL_DIR}" + "${NGHTTP3_DLL_DIR}/nghttp3.dll" + ) + set ( NGHTTP3_DLL ${_nghttp3_dll} + CACHE FILEPATH "nghttp3 DLL file name" + ) + file( GLOB _nghttp3_pdb RELATIVE "${NGHTTP3_DLL_DIR}" + "${NGHTTP3_DLL_DIR}/nghttp3.pdb" + ) + set ( NGHTTP3_PDB ${_nghttp3_pdb} + CACHE FILEPATH "nghttp3 PDB file name" + ) + mark_as_advanced( NGHTTP3_DLL_DIR NGHTTP3_DLL NGHTTP3_PDB ) + endif() +else() + set( NGHTTP3_INCLUDE_DIRS ) + set( NGHTTP3_LIBRARIES ) +endif() + +mark_as_advanced( NGHTTP3_LIBRARIES NGHTTP3_INCLUDE_DIRS ) |