This commit is contained in:
xiaoyifang 2024-11-19 15:11:15 +08:00
parent 675edc56b9
commit aa044a6f0a

View file

@ -85,12 +85,21 @@ if (WITH_ZIM)
target_link_libraries(${GOLDENDICT} PRIVATE PkgConfig::ZIM)
if (APPLE)
# brew list
execute_process(
COMMAND brew --prefix icu4c
OUTPUT_VARIABLE BREW_OUTPUT
ERROR_VARIABLE BREW_ERROR
RESULT_VARIABLE BREW_RESULT
)
# brew
message(STATUS "icu4c path:${BREW_OUTPUT}")
# ICU
# CMAKE_PREFIX_PATH
set(ICU_DEBUG ON)
set(ICU_ROOT "/usr/local/opt/icu4c")
message(STATUS "ICU_LIBRARIES: $(brew --prefix icu4c)")
find_package(ICU COMPONENTS i18n data uc)
find_package(ICU REQUIRED COMPONENTS i18n data uc)
message(STATUS "ICU_LIBRARIES: ${ICU_LIBRARIES}")
target_link_libraries(${GOLDENDICT} PRIVATE ${ICU_LIBRARIES})