From 5c682db0dd1cfd7090dd191e89613ad5fb9fc078 Mon Sep 17 00:00:00 2001 From: Allen Winter 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" )