From 76d3aeba00054b8fdef5d51a41585802522e7af6 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Mon, 24 Jan 2022 17:20:58 +0100 Subject: Fix ECMPoQmTools when using Qt6 --- modules/ECMPoQmTools.cmake | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/ECMPoQmTools.cmake b/modules/ECMPoQmTools.cmake index bf9efe0e..3b288064 100644 --- a/modules/ECMPoQmTools.cmake +++ b/modules/ECMPoQmTools.cmake @@ -145,10 +145,14 @@ function(ecm_process_po_files_as_qm lang) endif() # Find lrelease and lconvert - find_package(Qt${QT_MAJOR_VERSION}LinguistTools CONFIG REQUIRED) + if (QT_MAJOR_VERSION EQUAL "5") + find_package(Qt5LinguistTools CONFIG REQUIRED) + else() + find_package(Qt6 COMPONENTS LinguistTools CONFIG REQUIRED) + endif() - if(TARGET Qt5::lconvert) - set(lconvert_executable Qt5::lconvert) + if(TARGET Qt${QT_MAJOR_VERSION}::lconvert) + set(lconvert_executable Qt${QT_MAJOR_VERSION}::lconvert) else() # Qt < 5.3.1 does not define Qt5::lconvert get_target_property(lrelease_location Qt5::lrelease LOCATION) @@ -178,7 +182,7 @@ function(ecm_process_po_files_as_qm lang) add_custom_command(OUTPUT ${qm_file} COMMAND ${lconvert_executable} ARGS -i ${po_file} -o ${ts_file} -target-language ${lang} - COMMAND Qt5::lrelease + COMMAND Qt${QT_MAJOR_VERSION}::lrelease ARGS -removeidentical -nounfinished -silent ${ts_file} -qm ${qm_file} DEPENDS ${po_file} ) -- cgit v1.2.1