Add: Implement 2D map scrolling under SDL2 (#13167)
[openttd-github.git] / cmake / FindHarfbuzz.cmake
blob11a4dcb303fcad6d112c64f3fc62fb0b941326bb
1 #[=======================================================================[.rst:
2 FindHarfBuzz
3 -------
5 Finds the harfbuzz library.
7 Result Variables
8 ^^^^^^^^^^^^^^^^
10 This will define the following variables:
12 ``Harfbuzz_FOUND``
13   True if the system has the harfbuzz library.
14 ``Harfbuzz_INCLUDE_DIRS``
15   Include directories needed to use harfbuzz.
16 ``Harfbuzz_LIBRARIES``
17   Libraries needed to link to harfbuzz.
18 ``Harfbuzz_VERSION``
19   The version of the harfbuzz library which was found.
21 Cache Variables
22 ^^^^^^^^^^^^^^^
24 The following cache variables may also be set:
26 ``Harfbuzz_INCLUDE_DIR``
27   The directory containing ``hb.h``.
28 ``Harfbuzz_LIBRARY``
29   The path to the harfbuzz library.
31 #]=======================================================================]
33 find_package(PkgConfig QUIET)
34 pkg_check_modules(PC_Harfbuzz QUIET harfbuzz)
36 find_path(Harfbuzz_INCLUDE_DIR
37     NAMES hb.h
38     PATHS ${PC_Harfbuzz_INCLUDE_DIRS}
41 find_library(Harfbuzz_LIBRARY
42     NAMES harfbuzz
43     PATHS ${PC_Harfbuzz_LIBRARY_DIRS}
46 set(Harfbuzz_VERSION ${PC_Harfbuzz_VERSION})
48 include(FindPackageHandleStandardArgs)
49 find_package_handle_standard_args(Harfbuzz
50     FOUND_VAR Harfbuzz_FOUND
51     REQUIRED_VARS
52         Harfbuzz_LIBRARY
53         Harfbuzz_INCLUDE_DIR
54     VERSION_VAR Harfbuzz_VERSION
57 if(Harfbuzz_FOUND)
58     set(Harfbuzz_LIBRARIES ${Harfbuzz_LIBRARY})
59     set(Harfbuzz_INCLUDE_DIRS ${Harfbuzz_INCLUDE_DIR})
60 endif()
62 mark_as_advanced(
63     Harfbuzz_INCLUDE_DIR
64     Harfbuzz_LIBRARY