summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-02-22 08:29:03 +0100
committerStanislaw Halik <sthalik@misaki.pl>2017-02-22 08:29:03 +0100
commit4be202e6b5e57e185f2622cdab4e7bd13720167f (patch)
treec4efff09dd21e1dd3247e4cafced0ee3742aec75
parent6b1314c99897140b274fbcc7b5cbdf772d24f2e2 (diff)
cmake/i18n: express file dependencies correctly
Otherwise parallel make was doing lupdate -> lrelease out of order, leading to badness. Also build failing unless all .ts files existed. We need a way to bootstrap .ts files obviously.
-rw-r--r--cmake/opentrack-boilerplate.cmake9
-rw-r--r--cmake/opentrack-install.cmake16
2 files changed, 15 insertions, 10 deletions
diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake
index d9b3b64d..c1d3f4f7 100644
--- a/cmake/opentrack-boilerplate.cmake
+++ b/cmake/opentrack-boilerplate.cmake
@@ -221,9 +221,6 @@ function(opentrack_boilerplate n)
set(langs "")
foreach(i ${opentrack-all-translations})
set(t "${CMAKE_CURRENT_SOURCE_DIR}/lang/${i}.ts")
- if (NOT EXISTS "${t}")
- set_property(GLOBAL PROPERTY opentrack-force-i18n-regen TRUE)
- endif()
list(APPEND langs "${t}")
get_property(tt GLOBAL PROPERTY "opentrack-ts-${i}")
list(APPEND tt "${t}")
@@ -235,10 +232,12 @@ function(opentrack_boilerplate n)
set_property(GLOBAL PROPERTY opentrack-all-modules "${modules}")
if(NOT langs STREQUAL "")
- add_custom_target(i18n-module-${n}
+ add_custom_command(OUTPUT ${langs}
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_SOURCE_DIR}/lang"
COMMAND "${Qt5_DIR}/../../../bin/lupdate" -silent -recursive -no-obsolete -locations relative . -ts ${langs}
- WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+ COMMENT "Running lupdate for ${n}")
+ add_custom_target(i18n-module-${n} DEPENDS ${langs})
else()
add_custom_target(i18n-module-${n})
endif()
diff --git a/cmake/opentrack-install.cmake b/cmake/opentrack-install.cmake
index 844e77f5..66c0edee 100644
--- a/cmake/opentrack-install.cmake
+++ b/cmake/opentrack-install.cmake
@@ -57,8 +57,18 @@ function(merge_translations)
set(deps "")
+ get_property(maybe-force-i18n GLOBAL PROPERTY opentrack-force-i18n-regen)
+
+ if(SDK_REGEN_TRANSLATIONS OR maybe-force-i18n)
+ set(maybe-all ALL)
+ endif()
+
foreach(i ${opentrack-all-translations})
- get_property(ts GLOBAL PROPERTY "opentrack-ts-${i}")
+ get_property(ts_ GLOBAL PROPERTY "opentrack-ts-${i}")
+ set(ts "")
+ foreach(i ${ts_})
+ list(APPEND ts "${i}")
+ endforeach()
set(qm-output "${CMAKE_BINARY_DIR}/${i}.qm")
@@ -79,10 +89,6 @@ function(merge_translations)
endif()
endforeach()
set(maybe-all "")
- get_property(maybe-force-i18n GLOBAL PROPERTY opentrack-force-i18n-regen)
- if(SDK_REGEN_TRANSLATIONS OR maybe-force-i18n)
- set(maybe-all ALL)
- endif()
add_custom_target(i18n ${maybe-all} DEPENDS ${all-deps} ${deps})
endfunction()