From 99a58450f654adc206a6dbb075bfb8ee8ee69eea Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Tue, 19 Nov 2024 15:58:57 +0800 Subject: [PATCH] 1 --- cmake/Deps_Unix.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmake/Deps_Unix.cmake b/cmake/Deps_Unix.cmake index 72d4c73e..cc099115 100644 --- a/cmake/Deps_Unix.cmake +++ b/cmake/Deps_Unix.cmake @@ -78,8 +78,15 @@ endif () if (WITH_ZIM) if (APPLE) + + # 执行 brew list 命令并捕获输出 + execute_process( + COMMAND brew --prefix libzim + OUTPUT_VARIABLE LIBZIM_PATH + + ) # ICU from homebrew is "key-only", we need to manually prioritize it -> see `brew info icu4c` - set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/icu4c@76/lib/pkgconfig:/opt/homebrew/opt/icu4c@76/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:/opt/homebrew/opt/icu4c/lib/pkgconfig") + set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${LIBZIM_PATH}/lib/pkgconfig") endif () pkg_check_modules(ZIM REQUIRED IMPORTED_TARGET libzim) target_link_libraries(${GOLDENDICT} PRIVATE PkgConfig::ZIM)