FindNGHTTP3.cmake 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 1998 - 2022, 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.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. # SPDX-License-Identifier: curl
  22. #
  23. ###########################################################################
  24. #[=======================================================================[.rst:
  25. FindNGHTTP3
  26. ----------
  27. Find the nghttp3 library
  28. Result Variables
  29. ^^^^^^^^^^^^^^^^
  30. ``NGHTTP3_FOUND``
  31. System has nghttp3
  32. ``NGHTTP3_INCLUDE_DIRS``
  33. The nghttp3 include directories.
  34. ``NGHTTP3_LIBRARIES``
  35. The libraries needed to use nghttp3
  36. ``NGHTTP3_VERSION``
  37. version of nghttp3.
  38. #]=======================================================================]
  39. if(UNIX)
  40. find_package(PkgConfig QUIET)
  41. pkg_search_module(PC_NGHTTP3 libnghttp3)
  42. endif()
  43. find_path(NGHTTP3_INCLUDE_DIR nghttp3/nghttp3.h
  44. HINTS
  45. ${PC_NGHTTP3_INCLUDEDIR}
  46. ${PC_NGHTTP3_INCLUDE_DIRS}
  47. )
  48. find_library(NGHTTP3_LIBRARY NAMES nghttp3
  49. HINTS
  50. ${PC_NGHTTP3_LIBDIR}
  51. ${PC_NGHTTP3_LIBRARY_DIRS}
  52. )
  53. if(PC_NGHTTP3_VERSION)
  54. set(NGHTTP3_VERSION ${PC_NGHTTP3_VERSION})
  55. endif()
  56. include(FindPackageHandleStandardArgs)
  57. find_package_handle_standard_args(NGHTTP3
  58. REQUIRED_VARS
  59. NGHTTP3_LIBRARY
  60. NGHTTP3_INCLUDE_DIR
  61. VERSION_VAR NGHTTP3_VERSION
  62. )
  63. if(NGHTTP3_FOUND)
  64. set(NGHTTP3_LIBRARIES ${NGHTTP3_LIBRARY})
  65. set(NGHTTP3_INCLUDE_DIRS ${NGHTTP3_INCLUDE_DIR})
  66. endif()
  67. mark_as_advanced(NGHTTP3_INCLUDE_DIRS NGHTTP3_LIBRARIES)