diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-03-30 13:00:23 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-03-30 13:00:23 +0200 |
commit | 8660d0f4e141b32ce306144e95547a40926c62ed (patch) | |
tree | 3da664762608f779ad1fa799b689c0288e4027d7 /cmake/opentrack-install.cmake | |
parent | c3459749ce67e04757dac1f8e91af8203bacbe8f (diff) |
cmake: add skipping lupdate again
Diffstat (limited to 'cmake/opentrack-install.cmake')
-rw-r--r-- | cmake/opentrack-install.cmake | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/cmake/opentrack-install.cmake b/cmake/opentrack-install.cmake index 7731d561..73d76886 100644 --- a/cmake/opentrack-install.cmake +++ b/cmake/opentrack-install.cmake @@ -48,23 +48,39 @@ otr_inst2("${opentrack-doc-src-pfx}" FILES "${CMAKE_SOURCE_DIR}/OPENTRACK-LICENS otr_inst2("${opentrack-doc-src-pfx}" FILES "${CMAKE_SOURCE_DIR}/AUTHORS.md") function(merge_translations) + set(SDK_SKIP_TRANSLATION_UPDATE FALSE CACHE BOOL "") install(CODE "file(REMOVE_RECURSE \"\${CMAKE_INSTALL_PREFIX}/i18n\")") + set(all-ts-files "") + set(all-qm-files "") + foreach(i ${opentrack-all-translations}) get_property(ts-files GLOBAL PROPERTY "opentrack-ts-files-${i}") get_property(ts-deps GLOBAL PROPERTY "opentrack-ts-targets-${i}") - set(qm-output "${CMAKE_CURRENT_BINARY_DIR}/${i}.qm") + foreach(k ${ts-files}) + list(APPEND all-ts-files "${k}") + endforeach() + if(NOT ".${ts-files}" STREQUAL ".") + if(SDK_SKIP_TRANSLATION_UPDATE) + set(lrelease-deps "") + else() + set(lrelease-deps "${ts-files}") + endif() + + set(qm-output "${CMAKE_CURRENT_BINARY_DIR}/${i}.qm") + list(APPEND all-qm-files "${qm-output}") add_custom_command(OUTPUT "${qm-output}" COMMAND "${Qt5_DIR}/../../../bin/lrelease" -nounfinished -silent ${ts-files} -qm "${qm-output}" - DEPENDS ${ts-files} + DEPENDS ${lrelease-deps} COMMENT "Running lrelease for ${i}") set(lang-target "i18n-lang-${i}") - list(APPEND all-deps "${qm-output}") + install(FILES "${qm-output}" DESTINATION "${opentrack-i18n-pfx}" RENAME "${i}.qm" ${opentrack-perms}) endif() endforeach() - add_custom_target(i18n ALL DEPENDS ${all-deps}) + add_custom_target(i18n ALL DEPENDS ${all-qm-files}) + add_custom_target(force-i18n DEPENDS ${all-ts-files} ${all-qm-files} i18n) endfunction() |