Skip to content

Commit

Permalink
CMakeLists: install Qt translations to macOS bundle
Browse files Browse the repository at this point in the history
Closes #731.
  • Loading branch information
Kitsune Ral committed Dec 27, 2023
1 parent c1fcce3 commit 9ae4202
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,20 @@ 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 ${CMAKE_COMMAND} -E make_directory ${PROJECT_NAME}.app/Contents/Translations
COMMAND ${CMAKE_COMMAND} -E copy
"${_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

0 comments on commit 9ae4202

Please sign in to comment.