From 2b8610fcc4a34aec7c13cbe413076d9de74a9c03 Mon Sep 17 00:00:00 2001 From: Steveice10 <1269164+Steveice10@users.noreply.github.com> Date: Fri, 5 May 2023 22:39:00 -0700 Subject: [PATCH] qt: Update CMake translation targets. (#6506) --- CMakeModules/MinGWCross.cmake | 2 -- src/citra_qt/CMakeLists.txt | 14 +++++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CMakeModules/MinGWCross.cmake b/CMakeModules/MinGWCross.cmake index 837f8faf8..a21f03ab3 100644 --- a/CMakeModules/MinGWCross.cmake +++ b/CMakeModules/MinGWCross.cmake @@ -1,8 +1,6 @@ SET(MINGW_PREFIX /usr/x86_64-w64-mingw32/) SET(CMAKE_SYSTEM_NAME Windows) SET(CMAKE_SYSTEM_PROCESSOR x86_64) -# Actually a hack, w/o this will cause some strange errors -SET(CMAKE_HOST_WIN32 TRUE) SET(CMAKE_FIND_ROOT_PATH ${MINGW_PREFIX}) diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt index 067885488..b43508968 100644 --- a/src/citra_qt/CMakeLists.txt +++ b/src/citra_qt/CMakeLists.txt @@ -208,9 +208,13 @@ if (ENABLE_QT_TRANSLATION) # Update source TS file if enabled if (GENERATE_QT_TRANSLATION) - get_target_property(SRCS citra-qt SOURCES) - qt6_create_translation(QM_FILES ${SRCS} ${UIS} ${CITRA_QT_LANGUAGES}/en.ts) - add_custom_target(translation ALL DEPENDS ${CITRA_QT_LANGUAGES}/en.ts) + get_target_property(QT_SRCS citra-qt SOURCES) + get_target_property(QT_INCLUDES citra-qt INCLUDE_DIRECTORIES) + qt_add_lupdate(citra-qt TS_FILES ${CITRA_QT_LANGUAGES}/en.ts + SOURCES ${QT_SRCS} ${UIS} + INCLUDE_DIRECTORIES ${QT_INCLUDES} + NO_GLOBAL_TARGET) + add_custom_target(translation ALL DEPENDS citra-qt_lupdate) endif() # Find all TS files except en.ts @@ -218,7 +222,7 @@ if (ENABLE_QT_TRANSLATION) list(REMOVE_ITEM LANGUAGES_TS ${CITRA_QT_LANGUAGES}/en.ts) # Compile TS files to QM files - qt6_add_translation(LANGUAGES_QM ${LANGUAGES_TS}) + qt_add_lrelease(citra-qt TS_FILES ${LANGUAGES_TS} NO_GLOBAL_TARGET QM_FILES_OUTPUT_VARIABLE LANGUAGES_QM) # Build a QRC file from the QM file list set(LANGUAGES_QRC ${CMAKE_CURRENT_BINARY_DIR}/languages.qrc) @@ -230,7 +234,7 @@ if (ENABLE_QT_TRANSLATION) file(APPEND ${LANGUAGES_QRC} "") # Add the QRC file to package in all QM files - qt6_add_resources(LANGUAGES ${LANGUAGES_QRC}) + qt_add_resources(LANGUAGES ${LANGUAGES_QRC}) else() set(LANGUAGES) endif()