Skip to content

Commit

Permalink
use qt_add_translations under Qt 6
Browse files Browse the repository at this point in the history
  • Loading branch information
BLumia authored and chirs241097 committed Jan 15, 2024
1 parent c6e7b5d commit b6b52b5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions qmidiplayer-desktop/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit b6b52b5

Please sign in to comment.