File: FindNGHTTP3.cmake

package info (click to toggle)
wireshark 4.6.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 351,436 kB
  • sloc: ansic: 3,103,613; cpp: 129,736; xml: 100,978; python: 56,510; perl: 24,575; sh: 5,874; lex: 4,383; pascal: 4,304; makefile: 164; ruby: 113; objc: 91; tcl: 35
file content (62 lines) | stat: -rw-r--r-- 1,753 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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 )