From f8587020d785f10f2c230fdb0f52c45d0f10b703 Mon Sep 17 00:00:00 2001 From: Gary Wang Date: Sat, 20 Apr 2024 16:40:07 +0800 Subject: [PATCH] chore(CMake): make use of qt_add_translations --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index be233ed..5730dbb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,7 +115,11 @@ add_executable (${EXE_NAME} WIN32 ${PPIC_RC_FILES} ) -qt_create_translation(PPIC_QM_FILES ${PPIC_CPP_FILES_FOR_I18N} ${PPIC_TS_FILES}) +if (${QT_VERSION_MAJOR} EQUAL "6") + qt_add_translations(${EXE_NAME} TS_FILES ${PPIC_TS_FILES} QM_FILES_OUTPUT_VARIABLE PPIC_QM_FILES) +else() + qt_create_translation(PPIC_QM_FILES ${PPIC_CPP_FILES_FOR_I18N} ${PPIC_TS_FILES}) +endif() target_sources(${EXE_NAME} PRIVATE ${PPIC_QM_FILES})