From f8f62efa6e931aa4b3cfb9d0e3683dc50d276bf1 Mon Sep 17 00:00:00 2001 From: shenleban tongying Date: Wed, 6 Nov 2024 20:23:35 -0500 Subject: [PATCH] fix: deploy qt translations for macOS --- CMakeLists.txt | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f459721a..f0ca11d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -266,15 +266,25 @@ if (APPLE) set(Assembling_Dir "${CMAKE_BINARY_DIR}/redist") set(App_Name "${GOLDENDICT}.app") set(Redistributable_APP "${Assembling_Dir}/${App_Name}") - + + # if anything wrong, delete this and affect lines, and see what's Qt will generate by default. + set(QtConfPath "${Redistributable_APP}/Contents/Resources/qt.conf") + qt_generate_deploy_script( TARGET ${GOLDENDICT} OUTPUT_SCRIPT deploy_script - CONTENT "qt_deploy_runtime_dependencies( + CONTENT " + set(QT_DEPLOY_PREFIX \"${Redistributable_APP}\") + set(QT_DEPLOY_TRANSLATIONS_DIR \"Contents/Resources/translations\") + qt_deploy_runtime_dependencies( EXECUTABLE \"${Redistributable_APP}\" GENERATE_QT_CONF - NO_APP_STORE_COMPLIANCE - )" + NO_APP_STORE_COMPLIANCE) + qt_deploy_translations() + qt_deploy_qt_conf(\"${QtConfPath}\" + PLUGINS_DIR PlugIns + TRANSLATIONS_DIR Resources/translations) + " ) install(TARGETS ${GOLDENDICT} BUNDLE DESTINATION "${Assembling_Dir}")