Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Qt translations to the bundle for macOS #889

Merged
merged 2 commits into from
Dec 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ endif()

install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR})
BUNDLE DESTINATION .
)
if(LINUX)
install(FILES linux/${IDENTIFIER}.desktop
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
Expand Down Expand Up @@ -300,8 +301,19 @@ endif(WIN32)
# Packaging

if(APPLE)
execute_process(
COMMAND "${${Qt}_BinDir}/qmake" -query QT_INSTALL_TRANSLATIONS
OUTPUT_VARIABLE _qt_translations_dir
OUTPUT_STRIP_TRAILING_WHITESPACE
COMMAND_ERROR_IS_FATAL ANY
)
set(MACDEPLOYQT_ARGS ${PROJECT_NAME}.app -dmg -qmldir="${QML_DIR}" -verbose=${DEPLOY_VERBOSITY})
add_custom_target(image
COMMAND mkdir ${PROJECT_NAME}.app/Contents/Translations
COMMAND install "${_qt_translations_dir}/qtbase_*.qm"
"${_qt_translations_dir}/qtdeclarative_*.qm"
"${_qt_translations_dir}/qtmultimedia_*.qm"
${PROJECT_NAME}.app/Contents/Translations
COMMAND "${${Qt}_BinDir}/macdeployqt" ${MACDEPLOYQT_ARGS}
DEPENDS ${PROJECT_NAME}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
Expand Down