summaryrefslogtreecommitdiffhomepage
path: root/cmake/opentrack-boilerplate.cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-02-22 09:07:20 +0100
committerStanislaw Halik <sthalik@misaki.pl>2017-02-22 09:07:20 +0100
commit9339632c619b689451d5f962c9a9b29b9ebd0c93 (patch)
treeaf0e7f8eb1999ccf75350e16626ea951e524e7b4 /cmake/opentrack-boilerplate.cmake
parent497980e40ca695f2cf2db0161aac5b88f5d6688e (diff)
cmake: change translation regen logic
- lupdate runs after every source code change for that module - lrelease depends on .ts files created by lupdate - SDK_REGEN_TRANSLATIONS got removed - file dependencies are expressed right, so parallel build works
Diffstat (limited to 'cmake/opentrack-boilerplate.cmake')
-rw-r--r--cmake/opentrack-boilerplate.cmake21
1 files changed, 10 insertions, 11 deletions
diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake
index c1d3f4f7..1bd79a97 100644
--- a/cmake/opentrack-boilerplate.cmake
+++ b/cmake/opentrack-boilerplate.cmake
@@ -216,30 +216,29 @@ function(opentrack_boilerplate n)
endif()
endif()
- set(SDK_REGEN_TRANSLATIONS FALSE CACHE BOOL "Regenerate translation files on build")
-
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-ts-${i}")
list(APPEND tt "${t}")
set_property(GLOBAL PROPERTY "opentrack-ts-${i}" "${tt}")
endforeach()
- get_property(modules GLOBAL PROPERTY opentrack-all-modules)
list(APPEND modules "${n}")
set_property(GLOBAL PROPERTY opentrack-all-modules "${modules}")
- if(NOT langs STREQUAL "")
- add_custom_command(OUTPUT ${langs}
+ foreach(i ${langs})
+ add_custom_command(OUTPUT ${i}
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_SOURCE_DIR}/lang"
- COMMAND "${Qt5_DIR}/../../../bin/lupdate" -silent -recursive -no-obsolete -locations relative . -ts ${langs}
+ COMMAND "${Qt5_DIR}/../../../bin/lupdate" -silent -recursive -no-obsolete -locations relative . -ts "${i}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
- COMMENT "Running lupdate for ${n}")
- add_custom_target(i18n-module-${n} DEPENDS ${langs})
- else()
- add_custom_target(i18n-module-${n})
- endif()
+ DEPENDS ${${n}-all}
+ COMMENT "Running lupdate for ${i}")
+ endforeach()
+
+ add_custom_target(i18n-module-${n} DEPENDS ${langs})
endfunction()