aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Gary Wang <wzc782970009@gmail.com> 2024-01-15 17:46:54 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2024-01-15 10:52:01 -0500
commitb6b52b5bb6c7dc6382c7f481088df198f671f4d8 (patch)
tree0f2d77864794263abd8da2822024ac387fae57b2
parentc6e7b5d4ee8357db4127a522f583ec13590e3c8e (diff)
downloadQMidiPlayer-b6b52b5bb6c7dc6382c7f481088df198f671f4d8.tar.xz
use qt_add_translations under Qt 6
-rw-r--r--qmidiplayer-desktop/CMakeLists.txt12
1 files changed, 9 insertions, 3 deletions
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)