aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorVolker Krause <vkrause@kde.org>2022-01-24 17:20:58 +0100
committerVolker Krause <vkrause@kde.org>2022-01-24 17:20:58 +0100
commit76d3aeba00054b8fdef5d51a41585802522e7af6 (patch)
treec930873c829b2acc1d9837e6d86d14ec1f3ff492 /modules
parent33e3c5eb41ee9c5c3ea326e0b788f9efbfcf2e30 (diff)
downloadextra-cmake-modules-76d3aeba00054b8fdef5d51a41585802522e7af6.tar.gz
extra-cmake-modules-76d3aeba00054b8fdef5d51a41585802522e7af6.tar.bz2
Fix ECMPoQmTools when using Qt6
Diffstat (limited to 'modules')
-rw-r--r--modules/ECMPoQmTools.cmake12
1 files changed, 8 insertions, 4 deletions
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}
)