From eedd8dae926034ac727caad080767a3b62b503ea Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Fri, 14 Feb 2020 11:12:49 +0000 Subject: [PATCH] Fix harfbuzz detection Gbp-Pq: Name add-harfbuzz.patch --- cmake/Modules/FindHarfbuzz.cmake | 27 +++++++++++++++++++++++++++ cmake/Modules/FindPango.cmake | 1 + game/CMakeLists.txt | 1 + 3 files changed, 29 insertions(+) create mode 100644 cmake/Modules/FindHarfbuzz.cmake diff --git a/cmake/Modules/FindHarfbuzz.cmake b/cmake/Modules/FindHarfbuzz.cmake new file mode 100644 index 0000000..39551fe --- /dev/null +++ b/cmake/Modules/FindHarfbuzz.cmake @@ -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) + diff --git a/cmake/Modules/FindPango.cmake b/cmake/Modules/FindPango.cmake index bdddb9e..dc3ebd3 100644 --- a/cmake/Modules/FindPango.cmake +++ b/cmake/Modules/FindPango.cmake @@ -8,6 +8,7 @@ include(LibFindMacros) # Dependencies +libfind_package(Pango Harfbuzz) libfind_package(Pango Freetype) libfind_package(Pango Glib) libfind_package(Pango GObject) diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt index de33f2c..9cea871 100644 --- a/game/CMakeLists.txt +++ b/game/CMakeLists.txt @@ -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) -- 2.30.2