decrypt drsuapi attributes
[wireshark-sm.git] / cmake / modules / FindNGHTTP3.cmake
blob9ec5404b944ce306433f459cfa8ea82cb14bb254
1 # Find the system's Nghttp3 includes and library
3 #  NGHTTP3_INCLUDE_DIRS - where to find nghttp3.h
4 #  NGHTTP3_LIBRARIES    - List of libraries when using nghttp3
5 #  NGHTTP3_FOUND        - True if nghttp3 found
6 #  NGHTTP3_DLL_DIR      - (Windows) Path to the Nghttp2 DLL
7 #  NGHTTP3_DLL          - (Windows) Name of the Nghttp2 DLL
9 include( FindWSWinLibs )
10 FindWSWinLibs( "nghttp3-.*" "NGHTTP3_HINTS" )
12 if( NOT WIN32)
13   find_package(PkgConfig)
14   pkg_search_module(NGHTTP3 libnghttp3)
15 endif()
17 find_path( NGHTTP3_INCLUDE_DIR
18   NAMES nghttp3/nghttp3.h
19   HINTS
20     "${NGHTTP3_INCLUDEDIR}"
21     "${NGHTTP3_HINTS}/include"
22   PATHS /usr/local/include /usr/include
25 find_library( NGHTTP3_LIBRARY
26   NAMES nghttp3
27   HINTS
28     "${NGHTTP3_LIBDIR}"
29     "${NGHTTP3_HINTS}/lib"
30   PATHS /usr/local/lib /usr/lib
33 include( FindPackageHandleStandardArgs )
34 find_package_handle_standard_args( NGHTTP3 DEFAULT_MSG NGHTTP3_LIBRARY NGHTTP3_INCLUDE_DIR )
36 if( NGHTTP3_FOUND )
37   set( NGHTTP3_INCLUDE_DIRS ${NGHTTP3_INCLUDE_DIR} )
38   set( NGHTTP3_LIBRARIES ${NGHTTP3_LIBRARY} )
39   if (WIN32)
40     set ( NGHTTP3_DLL_DIR "${NGHTTP3_HINTS}/bin"
41       CACHE PATH "Path to nghttp3 DLL"
42     )
43     file( GLOB _nghttp3_dll RELATIVE "${NGHTTP3_DLL_DIR}"
44       "${NGHTTP3_DLL_DIR}/nghttp3.dll"
45     )
46     set ( NGHTTP3_DLL ${_nghttp3_dll}
47       CACHE FILEPATH "nghttp3 DLL file name"
48     )
49     file( GLOB _nghttp3_pdb RELATIVE "${NGHTTP3_DLL_DIR}"
50       "${NGHTTP3_DLL_DIR}/nghttp3.pdb"
51     )
52     set ( NGHTTP3_PDB ${_nghttp3_pdb}
53       CACHE FILEPATH "nghttp3 PDB file name"
54     )
55     mark_as_advanced( NGHTTP3_DLL_DIR NGHTTP3_DLL NGHTTP3_PDB )
56   endif()
57 else()
58   set( NGHTTP3_INCLUDE_DIRS )
59   set( NGHTTP3_LIBRARIES )
60 endif()
62 mark_as_advanced( NGHTTP3_LIBRARIES NGHTTP3_INCLUDE_DIRS )