diff options
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/opentrack-i18n.cmake | 13 | ||||
-rw-r--r-- | cmake/translation-stub.ts | 4 |
2 files changed, 15 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}") diff --git a/cmake/translation-stub.ts b/cmake/translation-stub.ts new file mode 100644 index 00000000..6401616d --- /dev/null +++ b/cmake/translation-stub.ts @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.1"> +</TS> |