From 5b7c089dd2fce88017fcdc5911801fc809175c0d Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 11 Jun 2018 17:49:58 +0800 Subject: [PATCH] Move qm_gen.pri --- qbittorrent.pro | 1 - src/app/CMakeLists.txt | 4 ++-- qm_gen.pri => src/lang/lang.pri | 8 ++++---- src/src.pro | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) rename qm_gen.pri => src/lang/lang.pri (64%) diff --git a/qbittorrent.pro b/qbittorrent.pro index 9f5de7d77..a7f2a137d 100644 --- a/qbittorrent.pro +++ b/qbittorrent.pro @@ -3,7 +3,6 @@ TEMPLATE = subdirs SUBDIRS += src include(version.pri) -include(qm_gen.pri) # Make target to create release tarball. Use 'make tarball' tarball.commands += rm -fR ../$${PROJECT_NAME}-$${PROJECT_VERSION}/ && diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index 60139bca5..e01da6524 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -31,8 +31,8 @@ find_package(Qt5 COMPONENTS LinguistTools REQUIRED) qt5_add_translation(QBT_QM_FILES ${QBT_TS_FILES}) get_filename_component(_lang_qrc_src "${CMAKE_CURRENT_SOURCE_DIR}/../lang/lang.qrc" ABSOLUTE) -get_filename_component(_lang_qrc_dst "${CMAKE_CURRENT_BINARY_DIR}/../lang.qrc" ABSOLUTE) -get_filename_component(_lang_qrc_dst_dir "${CMAKE_CURRENT_BINARY_DIR}/../" ABSOLUTE) +get_filename_component(_lang_qrc_dst "${CMAKE_CURRENT_BINARY_DIR}/../lang/lang.qrc" ABSOLUTE) +get_filename_component(_lang_qrc_dst_dir "${CMAKE_CURRENT_BINARY_DIR}/../lang" ABSOLUTE) message(STATUS "copying ${_lang_qrc_src} -> ${_lang_qrc_dst}") file(COPY ${_lang_qrc_src} DESTINATION ${_lang_qrc_dst_dir}) diff --git a/qm_gen.pri b/src/lang/lang.pri similarity index 64% rename from qm_gen.pri rename to src/lang/lang.pri index 7d31a4c3c..e08a6a20a 100644 --- a/qm_gen.pri +++ b/src/lang/lang.pri @@ -1,5 +1,5 @@ -TS_IN = $$fromfile(src/src.pro,TRANSLATIONS) -TS_IN_NOEXT = $$replace(TS_IN,".ts","") +TRANSLATIONS += $$files(qbittorrent_*.ts) +TS_IN_NOEXT = $$replace(TRANSLATIONS,".ts","") isEmpty(QMAKE_LRELEASE) { win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe @@ -16,6 +16,6 @@ isEmpty(QMAKE_LRELEASE) { message("Building translations") for(L,TS_IN_NOEXT) { message("Processing $${L}") - system("$$QMAKE_LRELEASE -silent src/$${L}.ts -qm src/$${L}.qm") - !exists("src/$${L}.qm"):error("Building translations failed, cannot continue") + system("$$QMAKE_LRELEASE -silent $${L}.ts -qm $${L}.qm") + !exists("$${L}.qm"):error("Building translations failed, cannot continue") } diff --git a/src/src.pro b/src/src.pro index cd4200a09..283099632 100644 --- a/src/src.pro +++ b/src/src.pro @@ -78,6 +78,6 @@ RESOURCES += \ searchengine/searchengine.qrc # Translations -TRANSLATIONS += $$files(lang/qbittorrent_*.ts) +include(lang/lang.pri) DESTDIR = .