From 8da1bc08b2ec7b1d3d8ef18a9f459b2ac4c0c2e4 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 14 Mar 2018 09:21:01 +0100 Subject: cmake/i18n: fix GNU make Issue: #726 Reported by: Artem Sobolev @ljgdasfhk --- cmake/opentrack-boilerplate.cmake | 7 +------ cmake/opentrack-i18n.cmake | 12 +++++++++++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake index 02826941..e4391257 100644 --- a/cmake/opentrack-boilerplate.cmake +++ b/cmake/opentrack-boilerplate.cmake @@ -207,14 +207,9 @@ function(otr_module n_) otr_compat(${n}) if(NOT arg_NO-QT) otr_i18n_for_target_directory(${n_}) - - foreach(k ${opentrack_all-translations}) - set(i18n-target "i18n-lang-${k}-module-${n_}") - add_dependencies("${n}" "${i18n-target}") - endforeach() endif() - set_property(GLOBAL APPEND PROPERTY opentrack-all-modules "${n}") + set_property(GLOBAL APPEND PROPERTY opentrack-all-modules "${n_}") set_property(GLOBAL APPEND PROPERTY opentrack-all-source-dirs "${CMAKE_CURRENT_SOURCE_DIR}") endfunction() diff --git a/cmake/opentrack-i18n.cmake b/cmake/opentrack-i18n.cmake index bc468e8a..34d1a3c3 100644 --- a/cmake/opentrack-i18n.cmake +++ b/cmake/opentrack-i18n.cmake @@ -27,6 +27,7 @@ function(otr_i18n_for_target_directory n) set(target-name "i18n-lang-${i}-module-${n}") add_custom_target(${target-name} DEPENDS "${t2}") set_property(GLOBAL APPEND PROPERTY "opentrack-ts-files-${i}" "${t2}") + set_property(GLOBAL APPEND PROPERTY "opentrack-ts-module-${n}" "${target-name}") endforeach() endfunction() @@ -42,6 +43,15 @@ function(otr_merge_translations) set(all-qm-files "") + get_property(all-modules GLOBAL PROPERTY opentrack-all-modules) + + set(all-ts-targets "") + + foreach(target ${all-modules}) + get_property(ts-targets GLOBAL PROPERTY "opentrack-ts-module-${target}") + list(APPEND all-ts-targets "${ts-targets}") + endforeach() + foreach(i ${opentrack_all-translations}) get_property(ts-files GLOBAL PROPERTY "opentrack-ts-files-${i}") get_property(lrelease-binary TARGET "${Qt5_LRELEASE_EXECUTABLE}" PROPERTY IMPORTED_LOCATION) @@ -51,7 +61,7 @@ function(otr_merge_translations) add_custom_command(OUTPUT "${qm-output}" COMMAND "${lrelease-binary}" -nounfinished -silent ${ts-files} -qm "${qm-output}" - DEPENDS ${ts-files} + DEPENDS ${all-ts-targets} COMMENT "Running lrelease for ${i}") install(FILES "${qm-output}" -- cgit v1.2.3