From a7f656a412697c42731e034063cb59187105f186 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 21 Oct 2015 12:35:52 +0300 Subject: [PATCH] Alwayse deploy QM files to test directory. --HG-- branch : develop --- common.pri | 25 +++++++++++++++++++++++++ src/app/valentina/valentina.pro | 5 ++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/common.pri b/common.pri index 4fbf0b1ba..f4a8a481d 100644 --- a/common.pri +++ b/common.pri @@ -64,6 +64,31 @@ defineTest(copyToDestdir) { message("----------------------------------------------end---------------------------------------------------") } +# Alwayse copies the given files to the destination directory +defineTest(forceCopyToDestdir) { + files = $$1 + DDIR = $$2 + mkpath($$DDIR) + + message("----------------------------------------------begin------------------------------------------------") + message("Copy to" $$DDIR "after link") + for(FILE, files) { + + # Replace slashes in paths with backslashes for Windows + win32{ + FILE ~= s,/,\\,g + DDIR ~= s,/,\\,g + } + QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$FILE) $$quote($$DDIR) $$escape_expand(\\n\\t) + message("Command:" $$QMAKE_COPY $$quote($$FILE) $$quote($$DDIR)) + QMAKE_CLEAN += $$DDIR/$$basename(FILE) + } + + export(QMAKE_POST_LINK) + export(QMAKE_CLEAN) + message("----------------------------------------------end---------------------------------------------------") +} + # We use precompiled headers for more fast compilation source code. defineReplace(set_PCH){ macx:clang*{ diff --git a/src/app/valentina/valentina.pro b/src/app/valentina/valentina.pro index 17a867114..e3c21a47e 100644 --- a/src/app/valentina/valentina.pro +++ b/src/app/valentina/valentina.pro @@ -2034,12 +2034,11 @@ for(_translation_name, INSTALL_TRANSLATIONS) { system($$shell_path($$[QT_INSTALL_BINS]/$$LRELEASE) $$shell_path($${PWD}/$${TRANSLATIONS_PATH}/$$_translation_name_ts) -qm $$shell_path($${PWD}/$$_translation_name)) unix { exists($${OUT_PWD}/$$DESTDIR/valentina) { - system(rm -fv $${OUT_PWD}/$$DESTDIR/valentina) + system(rm -fv $${OUT_PWD}/$$DESTDIR/valentina) # force to call linking } system(rm -fv $${OUT_PWD}/$$DESTDIR/translations/*.qm) } } - QMAKE_CLEAN += $${PWD}/$$_translation_name } for(DIR, INSTALL_TRANSLATIONS) { @@ -2050,7 +2049,7 @@ for(DIR, INSTALL_TRANSLATIONS) { } # Make possible run program even you do not install it. Seek files in local directory. -copyToDestdir($$tr_path, $$shell_path($${OUT_PWD}/$$DESTDIR/translations)) +forceCopyToDestdir($$tr_path, $$shell_path($${OUT_PWD}/$$DESTDIR/translations)) for(DIR, INSTALL_STANDARD_MEASHUREMENTS) { #add these absolute paths to a variable which