2
0

FindBearSSL.cmake 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 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. # Find the BearSSL library
  25. #
  26. # Input variables:
  27. #
  28. # - `BEARSSL_INCLUDE_DIR`: The BearSSL include directory.
  29. # - `BEARSSL_LIBRARY`: Path to `bearssl` library.
  30. #
  31. # Result variables:
  32. #
  33. # - `BEARSSL_FOUND`: System has BearSSL.
  34. # - `BEARSSL_INCLUDE_DIRS`: The BearSSL include directories.
  35. # - `BEARSSL_LIBRARIES`: The BearSSL library names.
  36. if(DEFINED BEARSSL_INCLUDE_DIRS AND NOT DEFINED BEARSSL_INCLUDE_DIR)
  37. message(WARNING "BEARSSL_INCLUDE_DIRS is deprecated, use BEARSSL_INCLUDE_DIR instead.")
  38. set(BEARSSL_INCLUDE_DIR "${BEARSSL_INCLUDE_DIRS}")
  39. unset(BEARSSL_INCLUDE_DIRS)
  40. endif()
  41. find_path(BEARSSL_INCLUDE_DIR NAMES "bearssl.h")
  42. find_library(BEARSSL_LIBRARY NAMES "bearssl")
  43. include(FindPackageHandleStandardArgs)
  44. find_package_handle_standard_args(BearSSL
  45. REQUIRED_VARS
  46. BEARSSL_INCLUDE_DIR
  47. BEARSSL_LIBRARY
  48. )
  49. if(BEARSSL_FOUND)
  50. set(BEARSSL_INCLUDE_DIRS ${BEARSSL_INCLUDE_DIR})
  51. set(BEARSSL_LIBRARIES ${BEARSSL_LIBRARY})
  52. endif()
  53. mark_as_advanced(BEARSSL_INCLUDE_DIR BEARSSL_LIBRARY)