decrypt drsuapi attributes
[wireshark-sm.git] / cmake / modules / FindNGHTTP2.cmake
blob5f06dbe91ad2297cdc4b50d40c6fd8e350148326
1 # Find the system's Nghttp2 includes and library
3 #  NGHTTP2_INCLUDE_DIRS - where to find nghttp2.h
4 #  NGHTTP2_LIBRARIES    - List of libraries when using nghttp2
5 #  NGHTTP2_FOUND        - True if nghttp2 found
6 #  NGHTTP2_DLL_DIR      - (Windows) Path to the Nghttp2 DLL
7 #  NGHTTP2_DLL          - (Windows) Name of the Nghttp2 DLL
9 include( FindWSWinLibs )
10 FindWSWinLibs( "nghttp2-.*" "NGHTTP2_HINTS" )
12 if( NOT USE_REPOSITORY)
13   find_package(PkgConfig)
14   pkg_search_module(NGHTTP2 libnghttp2)
15 endif()
17 find_path( NGHTTP2_INCLUDE_DIR
18   NAMES nghttp2/nghttp2.h
19   HINTS
20     "${NGHTTP2_INCLUDEDIR}"
21     "${NGHTTP2_HINTS}/include"
22   PATHS /usr/local/include /usr/include
25 find_library( NGHTTP2_LIBRARY
26   NAMES nghttp2
27   HINTS
28     "${NGHTTP2_LIBDIR}"
29     "${NGHTTP2_HINTS}/lib"
30   PATHS /usr/local/lib /usr/lib
33 include( FindPackageHandleStandardArgs )
34 find_package_handle_standard_args( NGHTTP2 DEFAULT_MSG NGHTTP2_LIBRARY NGHTTP2_INCLUDE_DIR )
36 if( NGHTTP2_FOUND )
37   set( NGHTTP2_INCLUDE_DIRS ${NGHTTP2_INCLUDE_DIR} )
38   set( NGHTTP2_LIBRARIES ${NGHTTP2_LIBRARY} )
39   if (WIN32)
40     set ( NGHTTP2_DLL_DIR "${NGHTTP2_HINTS}/bin"
41       CACHE PATH "Path to nghttp2 DLL"
42     )
43     file( GLOB _nghttp2_dll RELATIVE "${NGHTTP2_DLL_DIR}"
44       "${NGHTTP2_DLL_DIR}/nghttp2.dll"
45     )
46     set ( NGHTTP2_DLL ${_nghttp2_dll}
47       CACHE FILEPATH "nghttp2 DLL file name"
48     )
49     file( GLOB _nghttp2_pdb RELATIVE "${NGHTTP2_DLL_DIR}"
50       "${NGHTTP2_DLL_DIR}/nghttp2.pdb"
51     )
52     set ( NGHTTP2_PDB ${_nghttp2_pdb}
53       CACHE FILEPATH "nghttp2 PDB file name"
54     )
55     mark_as_advanced( NGHTTP2_DLL_DIR NGHTTP2_DLL NGHTTP2_PDB )
56   endif()
57 else()
58   set( NGHTTP2_INCLUDE_DIRS )
59   set( NGHTTP2_LIBRARIES )
60 endif()
62 mark_as_advanced( NGHTTP2_LIBRARIES NGHTTP2_INCLUDE_DIRS )