summaryrefslogtreecommitdiffhomepage
path: root/cmake/opentrack-install.cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-11-04 18:40:24 +0100
committerStanislaw Halik <sthalik@misaki.pl>2016-11-04 19:48:09 +0100
commitf08dc187499d2895f50f7e2e7e99bf698b0c0738 (patch)
tree7b15638804b92fb99ffa07dc45fb29aef4d7cd80 /cmake/opentrack-install.cmake
parenta308e5cd2c6769750f8f6b4e486a8e66b591dafe (diff)
cmake, main: add translation support
Diffstat (limited to 'cmake/opentrack-install.cmake')
-rw-r--r--cmake/opentrack-install.cmake28
1 files changed, 28 insertions, 0 deletions
diff --git a/cmake/opentrack-install.cmake b/cmake/opentrack-install.cmake
index 601c89c3..3e77e396 100644
--- a/cmake/opentrack-install.cmake
+++ b/cmake/opentrack-install.cmake
@@ -45,3 +45,31 @@ function(opentrack_install_sources n)
endforeach()
opentrack_inst2("${opentrack-doc-src-pfx}/${subdir}" FILES "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt")
endfunction()
+
+function(merge_translations)
+ set(all-deps "")
+
+ install(CODE "file(REMOVE_RECURSE \"\${CMAKE_INSTALL_PREFIX}/i18n\")")
+
+ get_property(modules GLOBAL PROPERTY opentrack-all-modules)
+
+ foreach(i ${opentrack-all-translations})
+ get_property(ts GLOBAL PROPERTY opentrack-${i}-ts)
+
+ set(qm-output "${CMAKE_BINARY_DIR}/${i}.qm")
+
+ set(deps "")
+ foreach(k ${modules})
+ list(APPEND deps "${k}-i18n")
+ endforeach()
+
+ add_custom_target(i18n-lang-${i}
+ COMMAND "${Qt5_DIR}/../../../bin/lrelease" -nounfinished -silent ${ts} -qm "${qm-output}"
+ DEPENDS ${deps}
+ )
+ list(APPEND all-deps "i18n-lang-${i}")
+ install(FILES "${qm-output}" DESTINATION "${opentrack-i18n-pfx}" RENAME "${i}.qm" ${opentrack-perms})
+ endforeach()
+ add_custom_target(i18n ALL DEPENDS ${all-deps})
+endfunction()
+