mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
Compare commits
6 commits
838979d529
...
6d3ad1ca70
Author | SHA1 | Date | |
---|---|---|---|
6d3ad1ca70 | |||
14bd118df6 | |||
cc4d040f1d | |||
1fa40c5801 | |||
75c11132e1 | |||
01892b2568 |
|
@ -284,7 +284,7 @@ if (APPLE)
|
||||||
set(QT_DEPLOY_TRANSLATIONS_DIR \"Contents/Resources/translations\")
|
set(QT_DEPLOY_TRANSLATIONS_DIR \"Contents/Resources/translations\")
|
||||||
qt_deploy_runtime_dependencies(
|
qt_deploy_runtime_dependencies(
|
||||||
EXECUTABLE \"${Redistributable_APP}\"
|
EXECUTABLE \"${Redistributable_APP}\"
|
||||||
ADDITIONAL_LIBRARIES \"${BREW_ICU_NEEDED_LIBS}\"
|
ADDITIONAL_LIBRARIES ${BREW_ICU_ADDITIONAL_DYLIBS}
|
||||||
GENERATE_QT_CONF
|
GENERATE_QT_CONF
|
||||||
NO_APP_STORE_COMPLIANCE)
|
NO_APP_STORE_COMPLIANCE)
|
||||||
qt_deploy_translations()
|
qt_deploy_translations()
|
||||||
|
|
|
@ -79,24 +79,25 @@ endif ()
|
||||||
if (WITH_ZIM)
|
if (WITH_ZIM)
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
# ICU from homebrew is "key-only", we need to manually prioritize it -> see `brew info icu4c`
|
# 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")
|
# And we needs to find the correct one if multiple versions co exists.
|
||||||
|
set(ENV{PATH} "$ENV{PATH}:/usr/local/bin/:/opt/homebrew/bin") # add brew command into PATH
|
||||||
|
execute_process(
|
||||||
|
COMMAND sh -c [=[brew --prefix $(brew deps libzim | grep icu4c)]=]
|
||||||
|
OUTPUT_VARIABLE ICU_REQUIRED_BY_ZIM_PREFIX
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
COMMAND_ERROR_IS_FATAL ANY)
|
||||||
|
message(STATUS "Found correct homebrew icu path -> ${ICU_REQUIRED_BY_ZIM_PREFIX}")
|
||||||
|
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${ICU_REQUIRED_BY_ZIM_PREFIX}/lib/pkgconfig")
|
||||||
|
message(STATUS "Updated pkg_config_path -> $ENV{PKG_CONFIG_PATH}:${ICU_REQUIRED_BY_ZIM_PREFIX}/lib/pkgconfig")
|
||||||
|
|
||||||
|
# icu4c as transitive dependency of libzim may not be automatically copied into app bundle
|
||||||
|
# so we manually discover the icu4c from homebrew, then find the relevent dylibs
|
||||||
|
set(BREW_ICU_ADDITIONAL_DYLIBS "${ICU_REQUIRED_BY_ZIM_PREFIX}/lib/libicudata.dylib ${ICU_REQUIRED_BY_ZIM_PREFIX}/lib/libicui18n.dylib ${ICU_REQUIRED_BY_ZIM_PREFIX}/lib/libicuuc.dylib")
|
||||||
|
message(STATUS "Additional ICU `.dylib`s -> ${BREW_ICU_ADDITIONAL_DYLIBS}")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
pkg_check_modules(ZIM REQUIRED IMPORTED_TARGET libzim)
|
pkg_check_modules(ZIM REQUIRED IMPORTED_TARGET libzim)
|
||||||
target_link_libraries(${GOLDENDICT} PRIVATE PkgConfig::ZIM)
|
target_link_libraries(${GOLDENDICT} PRIVATE PkgConfig::ZIM)
|
||||||
|
|
||||||
if (APPLE)
|
|
||||||
# icu4c as transitive dependency of libzim may not be automatically copied into app bundle
|
|
||||||
# so we manually discover the icu4c from homebrew, then find the relevent dylibs
|
|
||||||
pkg_check_modules(BREW_ICU REQUIRED IMPORTED_TARGET icu-i18n icu-uc)
|
|
||||||
if (BREW_ICU_INCLUDE_DIRS IN_LIST ZIM_INCLUDE_DIRS)
|
|
||||||
message(STATUS "ZIM OK!")
|
|
||||||
else ()
|
|
||||||
message(FATAL_ERROR "!!! ZIM <-> icu error -> check `brew info libzim` to know what libzim is depending.")
|
|
||||||
endif ()
|
|
||||||
set(BREW_ICU_NEEDED_LIBS "${BREW_ICU_LIBRARY_DIRS}/libicudata.dylib ${BREW_ICU_LIBRARY_DIRS}/libicui18n.dylib ${BREW_ICU_LIBRARY_DIRS}/libicuuc.dylib")
|
|
||||||
message(STATUS "Additional Libs -> ${BREW_ICU_NEEDED_LIBS}")
|
|
||||||
endif ()
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (USE_SYSTEM_FMT)
|
if (USE_SYSTEM_FMT)
|
||||||
|
|
Loading…
Reference in a new issue