FindNGHTTP3.cmake 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. #
  10. # This software is licensed as described in the file COPYING, which
  11. # you should have received as part of this distribution. The terms
  12. # are also available at https://curl.haxx.se/docs/copyright.html.
  13. #
  14. # You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. # copies of the Software, and permit persons to whom the Software is
  16. # furnished to do so, under the terms of the COPYING file.
  17. #
  18. # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. # KIND, either express or implied.
  20. #
  21. ###########################################################################
  22. #[=======================================================================[.rst:
  23. FindNGHTTP3
  24. ----------
  25. Find the nghttp3 library
  26. Result Variables
  27. ^^^^^^^^^^^^^^^^
  28. ``NGHTTP3_FOUND``
  29. System has nghttp3
  30. ``NGHTTP3_INCLUDE_DIRS``
  31. The nghttp3 include directories.
  32. ``NGHTTP3_LIBRARIES``
  33. The libraries needed to use nghttp3
  34. ``NGHTTP3_VERSION``
  35. version of nghttp3.
  36. #]=======================================================================]
  37. if(UNIX)
  38. find_package(PkgConfig QUIET)
  39. pkg_search_module(PC_NGHTTP3 libnghttp3)
  40. endif()
  41. find_path(NGHTTP3_INCLUDE_DIR nghttp3/nghttp3.h
  42. HINTS
  43. ${PC_NGHTTP3_INCLUDEDIR}
  44. ${PC_NGHTTP3_INCLUDE_DIRS}
  45. )
  46. find_library(NGHTTP3_LIBRARY NAMES nghttp3
  47. HINTS
  48. ${PC_NGHTTP3_LIBDIR}
  49. ${PC_NGHTTP3_LIBRARY_DIRS}
  50. )
  51. if(PC_NGHTTP3_VERSION)
  52. set(NGHTTP3_VERSION ${PC_NGHTTP3_VERSION})
  53. endif()
  54. include(FindPackageHandleStandardArgs)
  55. find_package_handle_standard_args(NGHTTP3
  56. REQUIRED_VARS
  57. NGHTTP3_LIBRARY
  58. NGHTTP3_INCLUDE_DIR
  59. VERSION_VAR NGHTTP3_VERSION
  60. )
  61. if(NGHTTP3_FOUND)
  62. set(NGHTTP3_LIBRARIES ${NGHTTP3_LIBRARY})
  63. set(NGHTTP3_INCLUDE_DIRS ${NGHTTP3_INCLUDE_DIR})
  64. endif()
  65. mark_as_advanced(NGHTTP3_INCLUDE_DIRS NGHTTP3_LIBRARIES)