diff options
| author | Joerg Bornemann <[email protected]> | 2022-09-06 10:50:12 +0200 |
|---|---|---|
| committer | Joerg Bornemann <[email protected]> | 2022-09-15 12:55:23 +0200 |
| commit | 514027f43fa526103da548f86d647ac33e288474 (patch) | |
| tree | 7de189e7dec955404083787e1cda4ecd34cc0276 /src | |
| parent | 1b5462c2acc2a543a41fd0a6a9d15df43e139fbc (diff) | |
CMake: Add NO_TRANSLATIONS option to deployment functions
Add the NO_TRANSLATIONS option to qt_deploy_runtime_dependencies and
qt_generate_deploy_app_script. On Windows and Linux, this option
prevents the deployment of Qt translations.
[ChangeLog][CMake] Added the NO_TRANSLATIONS option to
qt_deploy_runtime_dependencies and qt_generate_deploy_app_script.
Change-Id: I9d8435e262e2ff6c7242760ddb189473af850476
Reviewed-by: Alexandru Croitor <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/corelib/Qt6CoreDeploySupport.cmake | 14 | ||||
| -rw-r--r-- | src/corelib/Qt6CoreMacros.cmake | 12 | ||||
| -rw-r--r-- | src/corelib/doc/src/cmake/qt_deploy_runtime_dependencies.qdoc | 6 | ||||
| -rw-r--r-- | src/corelib/doc/src/cmake/qt_generate_deploy_app_script.qdoc | 6 |
4 files changed, 35 insertions, 3 deletions
diff --git a/src/corelib/Qt6CoreDeploySupport.cmake b/src/corelib/Qt6CoreDeploySupport.cmake index c2ff58a669f..6a300bdfdf3 100644 --- a/src/corelib/Qt6CoreDeploySupport.cmake +++ b/src/corelib/Qt6CoreDeploySupport.cmake @@ -113,6 +113,7 @@ endfunction() function(_qt_internal_generic_deployqt) set(no_value_options + NO_TRANSLATIONS VERBOSE ) set(single_value_options @@ -205,6 +206,11 @@ function(_qt_internal_generic_deployqt) string(PREPEND destination "${QT_DEPLOY_PREFIX}/${arg_PLUGINS_DIR}/") file(INSTALL ${file_path} DESTINATION ${destination}) endforeach() + + # Deploy translations. + if(NOT arg_NO_TRANSLATIONS) + qt6_deploy_translations() + endif() endfunction() # This function is currently in Technical Preview. @@ -220,6 +226,7 @@ function(qt6_deploy_runtime_dependencies) VERBOSE NO_OVERWRITE NO_APP_STORE_COMPLIANCE # TODO: Might want a better name + NO_TRANSLATIONS ) set(single_value_options EXECUTABLE @@ -318,6 +325,9 @@ function(qt6_deploy_runtime_dependencies) if(NOT arg_NO_OVERWRITE) list(APPEND tool_options --force) endif() + if(arg_NO_TRANSLATIONS) + list(APPEND tool_options --no-translations) + endif() elseif(__QT_DEPLOY_SYSTEM_NAME STREQUAL Darwin) set(extra_binaries_option "-executable=") if(NOT arg_NO_APP_STORE_COMPLIANCE) @@ -343,6 +353,10 @@ function(qt6_deploy_runtime_dependencies) list(APPEND tool_options ADDITIONAL_${file_type} ${arg_ADDITIONAL_${file_type}}) endforeach() + if(arg_NO_TRANSLATIONS) + list(APPEND tool_options NO_TRANSLATIONS) + endif() + _qt_internal_generic_deployqt( EXECUTABLE "${arg_EXECUTABLE}" LIB_DIR "${arg_LIB_DIR}" diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index c6d0d765e85..a887edf9c2d 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -2671,6 +2671,7 @@ function(qt6_generate_deploy_app_script) # package). We would add an EXECUTABLE keyword for that, which would be # mutually exclusive with the TARGET keyword. set(no_value_options + NO_TRANSLATIONS NO_UNSUPPORTED_PLATFORM_ERROR ) set(single_value_options @@ -2702,6 +2703,11 @@ function(qt6_generate_deploy_app_script) FILENAME_VARIABLE file_name ) + set(common_deploy_args "") + if(arg_NO_TRANSLATIONS) + string(APPEND common_deploy_args " NO_TRANSLATIONS\n") + endif() + if(APPLE AND NOT IOS AND QT6_IS_SHARED_LIBS_BUILD) # TODO: Handle non-bundle applications if possible. get_target_property(is_bundle ${arg_TARGET} MACOSX_BUNDLE) @@ -2715,7 +2721,7 @@ function(qt6_generate_deploy_app_script) CONTENT " qt6_deploy_runtime_dependencies( EXECUTABLE $<TARGET_FILE_NAME:${arg_TARGET}>.app -) +${common_deploy_args}) ") elseif(WIN32 AND QT6_IS_SHARED_LIBS_BUILD) @@ -2724,7 +2730,7 @@ qt6_deploy_runtime_dependencies( qt6_deploy_runtime_dependencies( EXECUTABLE $<TARGET_FILE:${arg_TARGET}> GENERATE_QT_CONF -) +${common_deploy_args}) ") elseif(UNIX AND NOT APPLE AND NOT ANDROID AND QT6_IS_SHARED_LIBS_BUILD) @@ -2733,7 +2739,7 @@ qt6_deploy_runtime_dependencies( qt6_deploy_runtime_dependencies( EXECUTABLE $<TARGET_FILE:${arg_TARGET}> GENERATE_QT_CONF -) +${common_deploy_args}) ") elseif(NOT arg_NO_UNSUPPORTED_PLATFORM_ERROR AND NOT QT_INTERNAL_NO_UNSUPPORTED_PLATFORM_ERROR) diff --git a/src/corelib/doc/src/cmake/qt_deploy_runtime_dependencies.qdoc b/src/corelib/doc/src/cmake/qt_deploy_runtime_dependencies.qdoc index f199e625940..16e3672b196 100644 --- a/src/corelib/doc/src/cmake/qt_deploy_runtime_dependencies.qdoc +++ b/src/corelib/doc/src/cmake/qt_deploy_runtime_dependencies.qdoc @@ -38,6 +38,7 @@ qt_deploy_runtime_dependencies( [VERBOSE] [NO_OVERWRITE] [NO_APP_STORE_COMPLIANCE] + [NO_TRANSLATIONS] ) \endcode @@ -113,6 +114,11 @@ By default, if \c{executable} is a macOS app bundle, only Qt plugins and Qt libraries that comply with Apple's app store requirements are deployed. The \c{NO_APP_STORE_COMPLIANCE} option can be given to disable that constraint. +On platforms other than macOS, Qt translations are automatically deployed. To +inhibit this behavior, specify \c{NO_TRANSLATIONS}. Use +\l{qt6_deploy_translations}{qt_deploy_translations} to deploy translations in a +customized way. + \sa {qt6_generate_deploy_app_script}{qt_generate_deploy_app_script()}, qt_deploy_qt_conf(), qt_deploy_qml_imports() diff --git a/src/corelib/doc/src/cmake/qt_generate_deploy_app_script.qdoc b/src/corelib/doc/src/cmake/qt_generate_deploy_app_script.qdoc index 8d059f4c867..f156db17c94 100644 --- a/src/corelib/doc/src/cmake/qt_generate_deploy_app_script.qdoc +++ b/src/corelib/doc/src/cmake/qt_generate_deploy_app_script.qdoc @@ -22,6 +22,7 @@ qt_generate_deploy_app_script( TARGET target FILENAME_VARIABLE var_name + [NO_TRANSLATIONS] [NO_UNSUPPORTED_PLATFORM_ERROR] ) \endcode @@ -59,6 +60,11 @@ scenarios, are not currently supported. Calling \c{qt_generate_deploy_app_script()} in such a case will result in a fatal error, unless the \c{NO_UNSUPPORTED_PLATFORM_ERROR} option is given. +On platforms other than macOS, Qt translations are automatically deployed. To +inhibit this behavior, specify \c{NO_TRANSLATIONS}. Use +\l{qt6_deploy_translations}{qt_deploy_translations} to deploy translations in a +customized way. + For deploying a QML application, use \l{qt6_generate_deploy_qml_app_script}{qt_generate_deploy_qml_app_script()} instead. |
