From a7257c75b9bdfdb1e13cb94d092820cc5b86abb3 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Wed, 28 Apr 2021 12:57:33 +1000 Subject: [PATCH] cmake: moved qt5_add_translation to parent scope Scope issues seem to cause problems where the main compile step can't find the translation step, so even though it's messier, this code is now in the parent scope. Fixes #1595 --- app/CMakeLists.txt | 15 +++++++++++++++ app/ts/CMakeLists.txt | 16 ---------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index db3732594..fc80a04ab 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -44,6 +44,21 @@ add_subdirectory(undo) add_subdirectory(widget) add_subdirectory(window) +# Add translations +qt5_add_translation(OLIVE_QM_FILES ${OLIVE_TS_FILES}) + +set(QRC_BODY "") +foreach(QM_FILE ${OLIVE_QM_FILES}) + get_filename_component(QM_FILENAME_COMPONENT ${QM_FILE} NAME_WE) + string(APPEND QRC_BODY "${QM_FILE}\n") +endforeach() +configure_file(ts/translations.qrc.in ts/translations.qrc @ONLY) + +set(OLIVE_RESOURCES + ${OLIVE_RESOURCES} + ${CMAKE_CURRENT_BINARY_DIR}/ts/translations.qrc +) + # Add main library add_library(libolive-editor OBJECT diff --git a/app/ts/CMakeLists.txt b/app/ts/CMakeLists.txt index 06de3d0d0..346600656 100644 --- a/app/ts/CMakeLists.txt +++ b/app/ts/CMakeLists.txt @@ -33,19 +33,3 @@ set(OLIVE_TS_FILES ts/zh_TW.ts PARENT_SCOPE ) - -# Add translations -qt5_add_translation(OLIVE_QM_FILES ${OLIVE_TS_FILES}) - -set(QRC_BODY "") -foreach(QM_FILE ${OLIVE_QM_FILES}) - get_filename_component(QM_FILENAME_COMPONENT ${QM_FILE} NAME_WE) - string(APPEND QRC_BODY "${QM_FILE}\n") -endforeach() -configure_file(translations.qrc.in translations.qrc @ONLY) - -set(OLIVE_RESOURCES - ${OLIVE_RESOURCES} - ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc - PARENT_SCOPE -)