From e9c9cc9975d80e91994051d18a95daef9f24d41a Mon Sep 17 00:00:00 2001 From: complexlogic Date: Sat, 27 Jul 2024 08:56:39 -0700 Subject: [PATCH] Fix build with Qt 6.7 --- .github/workflows/build.yml | 2 +- src/CMakeLists.txt | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d40447..73fd1c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ permissions: statuses: read env: - VCPKG_COMMITTISH: 53bef8994c541b6561884a8395ea35715ece75db + VCPKG_COMMITTISH: 1de2026f28ead93ff1773e6e680387643e914ea1 jobs: build_windows: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e7befae..eeb7bd3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -41,12 +41,6 @@ list(LENGTH LANGS NB_LANGS) string(REPLACE ";" "" LANG_PAIRS ${LANGS}) configure_file("${PROJECT_SOURCE_DIR}/translations/languages.hpp.in" "${PROJECT_BINARY_DIR}/languages.hpp") -# Make lupdate target for Qt 6 -if (${QT_VERSION} VERSION_GREATER_EQUAL "6") - qt_add_lupdate(${EXECUTABLE_NAME} - TS_FILES ${TS_FILES} "${PROJECT_SOURCE_DIR}/translations/source.ts" - ) -endif () qt_add_translation(QM_FILES "${TS_FILES}") foreach (FILE ${QM_FILES}) get_filename_component(BASENAME ${FILE} NAME) @@ -213,3 +207,12 @@ elseif (WIN32) endif () include(CPack) endif () + +# Make lupdate target for Qt 6 +if (${Qt${QT_VERSION}_VERSION} VERSION_GREATER_EQUAL 6.7) + qt_add_lupdate( + TS_FILES ${TS_FILES} "${PROJECT_SOURCE_DIR}/translations/source.ts" + SOURCE_TARGETS "${EXECUTABLE_NAME}" + LUPDATE_TARGET "update_translations" + ) +endif ()