summaryrefslogtreecommitdiffhomepage
path: root/cmake/opentrack-boilerplate.cmake
diff options
context:
space:
mode:
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})