summaryrefslogtreecommitdiffhomepage
path: root/cmake/opentrack-boilerplate.cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-03-22 07:56:57 +0100
committerStanislaw Halik <sthalik@misaki.pl>2017-03-22 07:56:57 +0100
commit46020a8ea488c2fb9ab94d1b927d109da9557f32 (patch)
treeaa6568262d45c6617e95ba21c1b7c80747d91f45 /cmake/opentrack-boilerplate.cmake
parentd55fbcc22be4c7be23af3e06fcbd04c43b50b988 (diff)
cmake: allow for skipping translation update
Diffstat (limited to 'cmake/opentrack-boilerplate.cmake')
-rw-r--r--cmake/opentrack-boilerplate.cmake21
1 files changed, 15 insertions, 6 deletions
diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake
index 58c07d1e..bda888fe 100644
--- a/cmake/opentrack-boilerplate.cmake
+++ b/cmake/opentrack-boilerplate.cmake
@@ -202,14 +202,23 @@ function(opentrack_boilerplate n)
endforeach()
set_property(GLOBAL APPEND PROPERTY opentrack-all-modules "${n}")
+ set(SDK_SKIP_TRANSLATION_UPDATE FALSE CACHE BOOL "Don't touch existing .ts files")
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 "${i}"
- WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
- DEPENDS ${${n}-all}
- COMMENT "Running lupdate for ${i}")
+ if(SDK_SKIP_TRANSLATION_UPDATE AND EXISTS "${i}")
+ add_custom_command(OUTPUT "${i}"
+ COMMAND ${CMAKE_COMMAND} -E touch_nocreate "${CMAKE_CURRENT_SOURCE_DIR}/lang"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+ DEPENDS ${${n}-all}
+ COMMENT "Fake lupdate for ${i}")
+ else()
+ 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 "${i}"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+ DEPENDS ${${n}-all}
+ COMMENT "Running lupdate for ${i}")
+ endif()
endforeach()
add_custom_target(i18n-module-${n} DEPENDS ${langs})