From 17a864bbc486aa182dc3c28b2adef7e4cd7ce7b8 Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Fri, 16 Jun 2023 09:42:36 +0200 Subject: [PATCH] Possible speedup for recompilation (translations) qt_add_translation also invokes lupdate which might invalidate the generated files. We don't need to call lupdate as we explicitly call it in the translation sync. --- src/resources/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/resources/CMakeLists.txt b/src/resources/CMakeLists.txt index 5d8a502d0b9..30fdcd055a8 100644 --- a/src/resources/CMakeLists.txt +++ b/src/resources/CMakeLists.txt @@ -30,8 +30,12 @@ generate_export_header(owncloudResources # Handle Translations, pick all client_* files from trans directory. file(GLOB client_translations ${CMAKE_SOURCE_DIR}/translations/client_*.ts) -qt_add_translation(client_compiled_translations ${client_translations}) -target_sources(owncloudResources PRIVATE ${client_compiled_translations}) +if (${QT_VERSION_MAJOR} GREATER_EQUAL 6 AND ${QT_VERSION_MAJOR} GREATER_EQUAL 2) + qt_add_lrelease(owncloudResources TS_FILES ${client_translations} QM_FILES_OUTPUT_VARIABLE client_compiled_translations) +else() + qt_add_translation(client_compiled_translations ${client_translations}) + target_sources(owncloudResources PRIVATE ${client_compiled_translations}) +endif() add_resources_to_target( TARGET owncloudResources PREFIX translations