summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorAllen Winter <allen.winter@kdab.com>2018-05-26 09:06:10 -0400
committerAllen Winter <allen.winter@kdab.com>2018-05-26 09:06:10 -0400
commit5c682db0dd1cfd7090dd191e89613ad5fb9fc078 (patch)
tree96cc9414ce9e877674543d655d6cf709156f2a67 /cmake
parentd2f0f96b621e17f2acb75b3ddd501fdd10c8ad4a (diff)
downloadlibical-git-5c682db0dd1cfd7090dd191e89613ad5fb9fc078.tar.gz
cmake/modules/FindICU.cmake - allow pkgconfig to get is a hint
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/FindICU.cmake13
1 files 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"
)