From b6b52b5bb6c7dc6382c7f481088df198f671f4d8 Mon Sep 17 00:00:00 2001 From: Gary Wang Date: Mon, 15 Jan 2024 17:46:54 +0800 Subject: use qt_add_translations under Qt 6 --- qmidiplayer-desktop/CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'qmidiplayer-desktop') diff --git a/qmidiplayer-desktop/CMakeLists.txt b/qmidiplayer-desktop/CMakeLists.txt index 5def90f..b878ccc 100644 --- a/qmidiplayer-desktop/CMakeLists.txt +++ b/qmidiplayer-desktop/CMakeLists.txt @@ -92,9 +92,15 @@ PRIVATE ${rtmidi_LIBRARY_DIRS} ) -file(GLOB qmpdesktop_TS_FILES translations/*.ts) -qt_create_translation(qmpdesktop_QM_FILES ${qmpdesktop_SOURCES} ${qmpdesktop_TS_FILES}) -add_custom_target(translations ALL DEPENDS ${qmpdesktop_QM_FILES}) +set(qmpdesktop_TS_FILES + translations/qmp_zh_CN.ts +) +if(${QT_VERSION_MAJOR} EQUAL "5") + qt_create_translation(qmpdesktop_QM_FILES ${qmpdesktop_SOURCES} ${qmpdesktop_TS_FILES}) + add_custom_target(translations ALL DEPENDS ${qmpdesktop_QM_FILES}) +else() + qt_add_translations(qmidiplayer TS_FILES ${qmpdesktop_TS_FILES} QM_FILES_OUTPUT_VARIABLE qmpdesktop_QM_FILES) +endif() install(TARGETS qmidiplayer) -- cgit v1.2.3