1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
From caea553262e1d40bf9caec84223b5d25989464c0 Mon Sep 17 00:00:00 2001
From: Orivej Desh <orivej@gmx.fr>
Date: Wed, 25 Mar 2020 14:17:06 +0000
Subject: [PATCH] Rely on pkg-config to find Pango
Fixes build with pango that needs -I/usr/include/harfbuzz (as specified in its
pkg config).
PkgConfig results can be overridded by setting e.g. Pango_PKGCONF_INCLUDEDIR,
Pango_PKGCONF_LDFLAGS (see FindPkgConfig documentation).
IMPORTED_TARGET was added in CMake 3.6.
Fixes #490
Closes #493
---
CMakeLists.txt | 2 +-
cmake/Modules/FindPango.cmake | 25 ++---------------------
cmake/Modules/FindPangoCairo.cmake | 32 ++++--------------------------
3 files changed, 7 insertions(+), 52 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f6e72942d..ca7ae4e92 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.6)
project(Performous CXX C)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
diff --git a/cmake/Modules/FindPango.cmake b/cmake/Modules/FindPango.cmake
index bdddb9e03..42cb199cc 100644
--- a/cmake/Modules/FindPango.cmake
+++ b/cmake/Modules/FindPango.cmake
@@ -2,31 +2,10 @@
# Once done, this will define
#
# Pango_FOUND - system has Pango
-# Pango_INCLUDE_DIRS - the Pango include directories
# Pango_LIBRARIES - link these to use Pango
include(LibFindMacros)
-# Dependencies
-libfind_package(Pango Freetype)
-libfind_package(Pango Glib)
-libfind_package(Pango GObject)
-
-# Use pkg-config to get hints about paths
-libfind_pkg_check_modules(Pango_PKGCONF pango)
-
-# Include dir
-find_path(Pango_INCLUDE_DIR
- NAMES pango/pango.h
- HINTS ${Pango_PKGCONF_INCLUDE_DIRS}
- PATH_SUFFIXES pango-1.0
-)
-
-# Finally the library itself
-find_library(Pango_LIBRARY
- NAMES pango-1.0
- HINTS ${Pango_PKGCONF_LIBRARY_DIRS}
-)
-
+libfind_pkg_check_modules(Pango_PKGCONF IMPORTED_TARGET pango)
+set(Pango_LIBRARY PkgConfig::Pango_PKGCONF)
libfind_process(Pango)
-
diff --git a/cmake/Modules/FindPangoCairo.cmake b/cmake/Modules/FindPangoCairo.cmake
index a26f83bd0..1c1a9e843 100644
--- a/cmake/Modules/FindPangoCairo.cmake
+++ b/cmake/Modules/FindPangoCairo.cmake
@@ -1,35 +1,11 @@
# - Try to find PangoCairo
# Once done, this will define
#
-# PangoCairo_FOUND - system has Pango
-# PangoCairo_INCLUDE_DIRS - the Pango include directories
-# PangoCairo_LIBRARIES - link these to use Pango
+# PangoCairo_FOUND - system has PangoCairo
+# PangoCairo_LIBRARIES - link these to use PangoCairo
include(LibFindMacros)
-# Dependencies
-libfind_package(PangoCairo Pango)
-libfind_package(PangoCairo Cairo)
-
-# Use pkg-config to get hints about paths
-libfind_pkg_check_modules(PangoCairo_PKGCONF pangocairo)
-
-# Include dir
-find_path(PangoCairo_INCLUDE_DIR
- NAMES pango/pangocairo.h
- HINTS ${PangoCairo_PKGCONF_INCLUDE_DIRS}
- PATH_SUFFIXES pango-1.0
-)
-
-# Finally the library itself
-find_library(PangoCairo_LIBRARY
- NAMES pangocairo-1.0
- HINTS ${PangoCairo_PKGCONF_LIBRARY_DIRS}
-)
-
-# Set the include dir variables and the libraries and let libfind_process do the rest.
-# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
-set(PangoCairo_PROCESS_INCLUDES PangoCairo_INCLUDE_DIR Pango_INCLUDE_DIR Cairo_INCLUDE_DIR)
-set(PangoCairo_PROCESS_LIBS PangoCairo_LIBRARY Pango_LIBRARY Cairo_LIBRARY)
+libfind_pkg_check_modules(PangoCairo_PKGCONF IMPORTED_TARGET pangocairo)
+set(PangoCairo_LIBRARY PkgConfig::PangoCairo_PKGCONF)
libfind_process(PangoCairo)
-
|