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)
17 find_path( NGHTTP2_INCLUDE_DIR
18 NAMES nghttp2/nghttp2.h
20 "${NGHTTP2_INCLUDEDIR}"
21 "${NGHTTP2_HINTS}/include"
22 PATHS /usr/local/include /usr/include
25 find_library( NGHTTP2_LIBRARY
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 )
37 set( NGHTTP2_INCLUDE_DIRS ${NGHTTP2_INCLUDE_DIR} )
38 set( NGHTTP2_LIBRARIES ${NGHTTP2_LIBRARY} )
40 set ( NGHTTP2_DLL_DIR "${NGHTTP2_HINTS}/bin"
41 CACHE PATH "Path to nghttp2 DLL"
43 file( GLOB _nghttp2_dll RELATIVE "${NGHTTP2_DLL_DIR}"
44 "${NGHTTP2_DLL_DIR}/nghttp2.dll"
46 set ( NGHTTP2_DLL ${_nghttp2_dll}
47 CACHE FILEPATH "nghttp2 DLL file name"
49 file( GLOB _nghttp2_pdb RELATIVE "${NGHTTP2_DLL_DIR}"
50 "${NGHTTP2_DLL_DIR}/nghttp2.pdb"
52 set ( NGHTTP2_PDB ${_nghttp2_pdb}
53 CACHE FILEPATH "nghttp2 PDB file name"
55 mark_as_advanced( NGHTTP2_DLL_DIR NGHTTP2_DLL NGHTTP2_PDB )
58 set( NGHTTP2_INCLUDE_DIRS )
59 set( NGHTTP2_LIBRARIES )
62 mark_as_advanced( NGHTTP2_LIBRARIES NGHTTP2_INCLUDE_DIRS )