summaryrefslogtreecommitdiff
path: root/dev-libs/libical/files/libical-3.0.3-findicu-pkgconfig.patch
blob: 7f0ffc4b4280ee85375164d91c407634db147749 (plain)
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
From 5c682db0dd1cfd7090dd191e89613ad5fb9fc078 Mon Sep 17 00:00:00 2001
From: Allen Winter <allen.winter@kdab.com>
Date: Sat, 26 May 2018 09:06:10 -0400
Subject: [PATCH] cmake/modules/FindICU.cmake - allow pkgconfig to get is a
 hint

---
 cmake/modules/FindICU.cmake | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/cmake/modules/FindICU.cmake b/cmake/modules/FindICU.cmake
index 12a1812d..53213efe 100644
--- a/cmake/modules/FindICU.cmake
+++ b/cmake/modules/FindICU.cmake
@@ -23,16 +23,12 @@ if(WIN32)
   file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _program_FILES_DIR)
 endif()
 
-if(ICU_INCLUDE_DIR AND ICU_LIBRARY)
-  # Already in cache, be silent
-  set(ICU_FIND_QUIETLY TRUE)
-endif()
-
-#set the root from the ICU_BASE environment
 file(TO_NATIVE_PATH "$ENV{ICU_BASE}" icu_root)
-#override the root from ICU_BASE defined to cmake
 if(DEFINED ICU_BASE)
   file(TO_NATIVE_PATH "${ICU_BASE}" icu_root)
+else()
+  find_package(PkgConfig QUIET)
+  pkg_check_modules(PC_LibICU QUIET icu-i18n)
 endif()
 
 # Look for the header file.
@@ -42,6 +38,7 @@ find_path(
   HINTS
   ${icu_root}/include
   ${_program_FILES_DIR}/icu/include
+  ${PC_LibICU_INCLUDEDIR}
   /usr/local/opt/icu4c/include
   DOC "Include directory for the ICU library"
 )
@@ -56,6 +53,7 @@ find_library(
   ${icu_root}/lib/
   ${_program_FILES_DIR}/icu/lib64/
   ${_program_FILES_DIR}/icu/lib/
+  ${PC_LibICU_LIBDIR}
   /usr/local/opt/icu4c/lib/
   DOC "Libraries to link against for the common parts of ICU"
 )
@@ -98,6 +96,7 @@ if(ICU_INCLUDE_DIR AND ICU_LIBRARY)
     HINTS
     ${icu_root}/lib/
     ${_program_FILES_DIR}/icu/lib/
+    ${PC_LibICU_LIBDIR}
     /usr/local/opt/icu4c/lib/
     DOC "Libraries to link against for ICU internationalization"
   )