From 49d449c2112fa2aa52302dcc40f16901305348fa Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 3 Sep 2023 20:35:57 +0200 Subject: [PATCH] i18n: enable Qt6 build of lang/ and libcalamares translations --- CMakeLists.txt | 2 -- CMakeModules/CalamaresAddBrandingSubdirectory.cmake | 2 +- lang/CMakeLists.txt | 8 ++++---- src/libcalamares/CMakeLists.txt | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8757a543a..a8940c6d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -453,9 +453,7 @@ endif() set(CALAMARES_TRANSLATION_LANGUAGES en ${_tx_complete} ${_tx_good} ${_tx_ok}) list(SORT CALAMARES_TRANSLATION_LANGUAGES) -if(NOT WITH_QT6) # TODO: Qt6 add_subdirectory(lang) # i18n tools -endif() ### Example Distro # diff --git a/CMakeModules/CalamaresAddBrandingSubdirectory.cmake b/CMakeModules/CalamaresAddBrandingSubdirectory.cmake index 062ad6706..7ae7da235 100644 --- a/CMakeModules/CalamaresAddBrandingSubdirectory.cmake +++ b/CMakeModules/CalamaresAddBrandingSubdirectory.cmake @@ -101,7 +101,7 @@ function( calamares_add_branding_translations NAME ) file( GLOB BRANDING_TRANSLATION_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${SUBDIRECTORY}/lang/calamares-${NAME}_*.ts" ) if ( BRANDING_TRANSLATION_FILES ) - qt5_add_translation( QM_FILES ${BRANDING_TRANSLATION_FILES} ) + qt_add_translation( QM_FILES ${BRANDING_TRANSLATION_FILES} ) add_custom_target( branding-translation-${NAME} ALL DEPENDS ${QM_FILES} COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/${SUBDIRECTORY}/lang/ COMMAND ${CMAKE_COMMAND} -E copy ${QM_FILES} ${CMAKE_CURRENT_BINARY_DIR}/${SUBDIRECTORY}/lang/ diff --git a/lang/CMakeLists.txt b/lang/CMakeLists.txt index 7494692c6..fc3a1db1e 100644 --- a/lang/CMakeLists.txt +++ b/lang/CMakeLists.txt @@ -15,10 +15,10 @@ include(CalamaresAddTranslations) -find_package(Qt5 COMPONENTS Xml) -if(Qt5Xml_FOUND) +find_package(${qtname} COMPONENTS Xml) +if(TARGET ${qtname}::Xml) add_executable(txload txload.cpp) - target_link_libraries(txload Qt5::Xml) + target_link_libraries(txload ${qtname}::Xml) endif() install_calamares_gettext_translations(python @@ -50,7 +50,7 @@ set(CALAMARES_TRANSLATIONS_SOURCE ${trans_outfile}) configure_file(${CMAKE_SOURCE_DIR}/lang/calamares_i18n.qrc.in ${trans_infile} @ONLY) -qt5_add_translation(QM_FILES ${TS_FILES}) +qt_add_translation(QM_FILES ${TS_FILES}) # Run the resource compiler (rcc_options should already be set) add_custom_command( diff --git a/src/libcalamares/CMakeLists.txt b/src/libcalamares/CMakeLists.txt index bb16d356d..dd4e08689 100644 --- a/src/libcalamares/CMakeLists.txt +++ b/src/libcalamares/CMakeLists.txt @@ -222,7 +222,7 @@ function(calamares_qrc_translations basename) endforeach() configure_file(${CMAKE_SOURCE_DIR}/lang/calamares_i18n.qrc.in ${translations_qrc_infile} @ONLY) - qt5_add_translation(QM_FILES ${calamares_i18n_ts_filelist}) + qt_add_translation(QM_FILES ${calamares_i18n_ts_filelist}) # Run the resource compiler (rcc_options should already be set) add_custom_command(