FindHarfbuzz.cmake 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #.rst:
  2. # Find HarfBuzz
  3. # -------------
  4. #
  5. # Finds the HarfBuzz library. This module defines:
  6. #
  7. # HarfBuzz_FOUND - True if HarfBuzz library is found
  8. # HarfBuzz::HarfBuzz - HarfBuzz imported target
  9. #
  10. # Additionally these variables are defined for internal usage:
  11. #
  12. # HARFBUZZ_LIBRARY - HarfBuzz library
  13. # HARFBUZZ_LIBRARIES - Same as HARFBUZZ_LIBRARY
  14. # HARFBUZZ_INCLUDE_DIR - Include dir
  15. #
  16. #
  17. # This file is part of Magnum.
  18. #
  19. # Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
  20. # Vladimír Vondruš <mosra@centrum.cz>
  21. #
  22. # Permission is hereby granted, free of charge, to any person obtaining a
  23. # copy of this software and associated documentation files (the "Software"),
  24. # to deal in the Software without restriction, including without limitation
  25. # the rights to use, copy, modify, merge, publish, distribute, sublicense,
  26. # and/or sell copies of the Software, and to permit persons to whom the
  27. # Software is furnished to do so, subject to the following conditions:
  28. #
  29. # The above copyright notice and this permission notice shall be included
  30. # in all copies or substantial portions of the Software.
  31. #
  32. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  33. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  34. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  35. # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  36. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  37. # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  38. # DEALINGS IN THE SOFTWARE.
  39. #
  40. # Library
  41. find_library(HARFBUZZ_LIBRARY NAMES harfbuzz)
  42. # Include dir
  43. find_path(HARFBUZZ_INCLUDE_DIR
  44. NAMES hb.h
  45. PATH_SUFFIXES harfbuzz)
  46. include(FindPackageHandleStandardArgs)
  47. find_package_handle_standard_args(HarfBuzz DEFAULT_MSG
  48. HARFBUZZ_LIBRARY
  49. HARFBUZZ_INCLUDE_DIR)
  50. mark_as_advanced(FORCE
  51. HARFBUZZ_LIBRARY
  52. HARFBUZZ_INCLUDE_DIR)
  53. if(NOT TARGET HarfBuzz::HarfBuzz)
  54. add_library(HarfBuzz::HarfBuzz UNKNOWN IMPORTED)
  55. set_target_properties(HarfBuzz::HarfBuzz PROPERTIES
  56. IMPORTED_LOCATION ${HARFBUZZ_LIBRARY}
  57. INTERFACE_INCLUDE_DIRECTORIES ${HARFBUZZ_INCLUDE_DIR})
  58. endif()
  59. set(HARFBUZZ_LIBRARIES ${HARFBUZZ_LIBRARY})