Fix harfbuzz detection
authorDimitri John Ledkov <xnox@ubuntu.com>
Tue, 14 Sep 2021 08:00:34 +0000 (09:00 +0100)
committerGianfranco Costamagna <locutusofborg@debian.org>
Tue, 14 Sep 2021 08:00:34 +0000 (09:00 +0100)
Gbp-Pq: Name add-harfbuzz.patch

cmake/Modules/FindHarfbuzz.cmake [new file with mode: 0644]
cmake/Modules/FindPango.cmake
game/CMakeLists.txt

diff --git a/cmake/Modules/FindHarfbuzz.cmake b/cmake/Modules/FindHarfbuzz.cmake
new file mode 100644 (file)
index 0000000..39551fe
--- /dev/null
@@ -0,0 +1,27 @@
+# - Try to find Harfbuzz
+# Once done, this will define
+#
+#  Harfbuzz_FOUND - system has Harfbuzz
+#  Harfbuzz_INCLUDE_DIRS - the Harfbuzz include directories
+#  Harfbuzz_LIBRARIES - link these to use Harfbuzz
+
+include(LibFindMacros)
+
+# Use pkg-config to get hints about paths
+libfind_pkg_check_modules(Harfbuzz_PKGCONF harfbuzz)
+
+# Include dir
+find_path(Harfbuzz_INCLUDE_DIR
+  NAMES harfbuzz/hb.h
+  HINTS ${Harfbuzz_PKGCONF_INCLUDE_DIRS}
+  PATH_SUFFIXES harfbuzz
+)
+
+# Finally the library itself
+find_library(Harfbuzz_LIBRARY
+  NAMES harfbuzz
+  HINTS ${Harfbuzz_PKGCONF_LIBRARY_DIRS}
+)
+
+libfind_process(Harfbuzz)
+
index bdddb9e03eb732e9fbb03f6a6b37f054eaa3ab86..dc3ebd39027578e5c5c80079674c927e9171e06a 100644 (file)
@@ -8,6 +8,7 @@
 include(LibFindMacros)
 
 # Dependencies
+libfind_package(Pango Harfbuzz)
 libfind_package(Pango Freetype)
 libfind_package(Pango Glib)
 libfind_package(Pango GObject)
index de33f2c2380366be1ced498e9f33b07d340b0ec2..9cea8712dabac4b99f91836593a484f6f4cad16d 100644 (file)
@@ -86,6 +86,7 @@ foreach(lib ${OUR_LIBS} SDL2 PangoCairo LibRSVG LibXML++ AVFormat SWResample SWS
        find_package(${lib} REQUIRED)
        message(STATUS "${lib} includes: ${${lib}_INCLUDE_DIRS}")
        include_directories(${${lib}_INCLUDE_DIRS})
+       include_directories(${${lib}_PKGCONF_INCLUDE_DIRS})
        list(APPEND LIBS ${${lib}_LIBRARIES})
        add_definitions(${${lib}_DEFINITIONS})
 endforeach(lib)