summaryrefslogtreecommitdiffhomepage
path: root/cmake/opentrack-i18n.cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-04-06 06:06:01 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-04-27 20:26:17 +0200
commit27defd345dd8d98ecde6cfb70422c158bd2a4e0e (patch)
tree85ed28e1466142ba5fd2d0fe46727c6fe9ea30e9 /cmake/opentrack-i18n.cmake
parent2196b0adfb180942ab6102f58adefd9b0c953321 (diff)
cmake/i18n: fixes
- fix build error on missing .ts files - show duplicate string details - prevent lines of "cmd /c" in Ninja output
Diffstat (limited to 'cmake/opentrack-i18n.cmake')
-rw-r--r--cmake/opentrack-i18n.cmake13
1 files changed, 11 insertions, 2 deletions
diff --git a/cmake/opentrack-i18n.cmake b/cmake/opentrack-i18n.cmake
index 19589971..6811d5e9 100644
--- a/cmake/opentrack-i18n.cmake
+++ b/cmake/opentrack-i18n.cmake
@@ -8,6 +8,10 @@ function(otr_i18n_for_target_directory n)
set(t "${CMAKE_CURRENT_SOURCE_DIR}/lang/${i}.ts")
set(t2 "${CMAKE_CURRENT_BINARY_DIR}/lang/${i}.ts")
set(input "${${k}-all}")
+ if (NOT EXISTS "${t}")
+ file(READ "${CMAKE_CURRENT_LIST_DIR}/translation-stub.ts")
+ file(WRITE "${t}")
+ endif()
add_custom_command(OUTPUT "${t2}"
COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_SOURCE_DIR}/lang"
COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/lang"
@@ -26,7 +30,7 @@ function(otr_i18n_for_target_directory n)
set_property(SOURCE ${input} PROPERTY GENERATED TRUE)
set(target-name "i18n-lang-${i}-module-${n}")
list(APPEND target-names "${target-name}")
- add_custom_target(${target-name} DEPENDS "${t2}" "${t}" COMMENT "Translation strings for ${n}")
+ add_custom_target(${target-name} DEPENDS "${t2}" "${t}" COMMENT "Updating translation strings for ${n}")
set_property(GLOBAL APPEND PROPERTY "opentrack-ts-files-${i}" "${t2}")
set_property(GLOBAL APPEND PROPERTY "opentrack-ts-module-${n}" "${target-name}")
endforeach()
@@ -62,7 +66,12 @@ function(otr_merge_translations)
list(APPEND all-qm-files "${qm-output}")
add_custom_command(OUTPUT "${qm-output}"
- COMMAND "${lrelease-binary}" -nounfinished -silent ${ts-files} -qm "${qm-output}"
+ COMMAND "${lrelease-binary}"
+ -nounfinished
+ #-silent
+ -verbose
+ ${ts-files}
+ -qm "${qm-output}"
DEPENDS ${all-ts-targets}
COMMENT "Running lrelease for ${i}")