From aa044a6f0a2ee7d84dcd0bc5f07bad44d729d04a Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Tue, 19 Nov 2024 15:11:15 +0800 Subject: [PATCH] 1 --- cmake/Deps_Unix.cmake | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/cmake/Deps_Unix.cmake b/cmake/Deps_Unix.cmake index 234e2662..b30487cd 100644 --- a/cmake/Deps_Unix.cmake +++ b/cmake/Deps_Unix.cmake @@ -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})