summaryrefslogtreecommitdiffhomepage
path: root/cmake/opentrack-boilerplate.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-boilerplate.cmake
parenta308e5cd2c6769750f8f6b4e486a8e66b591dafe (diff)
cmake, main: add translation support
Diffstat (limited to 'cmake/opentrack-boilerplate.cmake')
-rw-r--r--cmake/opentrack-boilerplate.cmake20
1 files changed, 20 insertions, 0 deletions
diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake
index 8efc6129..fc26f685 100644
--- a/cmake/opentrack-boilerplate.cmake
+++ b/cmake/opentrack-boilerplate.cmake
@@ -214,4 +214,24 @@ function(opentrack_boilerplate n)
opentrack_install_pdb_current_project()
endif()
endif()
+
+ set(langs "")
+ foreach(i ${opentrack-all-translations})
+ set(t "${CMAKE_CURRENT_SOURCE_DIR}/lang/${i}.ts")
+ list(APPEND langs "${t}")
+ get_property(tt GLOBAL PROPERTY opentrack-${i}-ts)
+ set(tt ${tt} ${t})
+ set_property(GLOBAL PROPERTY opentrack-${i}-ts ${tt})
+ endforeach()
+
+ get_property(modules GLOBAL PROPERTY opentrack-all-modules)
+ list(APPEND modules "${n}")
+ set_property(GLOBAL PROPERTY opentrack-all-modules "${modules}")
+
+ add_custom_target(${n}-i18n
+ COMMAND cmake -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}"
+ SOURCES ${langs})
endfunction()
+