diff options
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/opentrack-boilerplate.cmake | 13 | ||||
-rw-r--r-- | cmake/opentrack-install.cmake | 18 |
2 files changed, 14 insertions, 17 deletions
diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake index bda888fe..32829279 100644 --- a/cmake/opentrack-boilerplate.cmake +++ b/cmake/opentrack-boilerplate.cmake @@ -204,24 +204,21 @@ function(opentrack_boilerplate n) set_property(GLOBAL APPEND PROPERTY opentrack-all-modules "${n}") set(SDK_SKIP_TRANSLATION_UPDATE FALSE CACHE BOOL "Don't touch existing .ts files") + set(langs_ "") + foreach(i ${langs}) - 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() + if((NOT SDK_SKIP_TRANSLATION_UPDATE) OR (NOT EXISTS "${i}")) 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}") + list(APPEND langs_ "${i}") endif() endforeach() - add_custom_target(i18n-module-${n} DEPENDS ${langs}) + add_custom_target(i18n-module-${n} DEPENDS ${langs_}) if(NOT arg_NO-INSTALL) set_property(GLOBAL APPEND PROPERTY opentrack-all-source-dirs "${CMAKE_CURRENT_SOURCE_DIR}") diff --git a/cmake/opentrack-install.cmake b/cmake/opentrack-install.cmake index c42ecd91..e4f3b2b2 100644 --- a/cmake/opentrack-install.cmake +++ b/cmake/opentrack-install.cmake @@ -65,15 +65,15 @@ function(merge_translations) set(qm-output "${CMAKE_BINARY_DIR}/${i}.qm") - add_custom_command(OUTPUT "${qm-output}" - COMMAND "${Qt5_DIR}/../../../bin/lrelease" -nounfinished -silent ${ts} -qm "${qm-output}" - DEPENDS ${deps} ${ts} - COMMENT "Running lrelease for ${i}") - - add_custom_target(i18n-lang-${i} ALL DEPENDS "${qm-output}") - - list(APPEND all-deps "i18n-lang-${i}") - install(FILES "${qm-output}" DESTINATION "${opentrack-i18n-pfx}" RENAME "${i}.qm" ${opentrack-perms}) + if("${ts}") + add_custom_command(OUTPUT "${qm-output}" + COMMAND "${Qt5_DIR}/../../../bin/lrelease" -nounfinished -silent ${ts} -qm "${qm-output}" + DEPENDS ${deps} ${ts} + COMMENT "Running lrelease for ${i}") + add_custom_target(i18n-lang-${i} ALL DEPENDS "${qm-output}") + list(APPEND all-deps "i18n-lang-${i}") + install(FILES "${qm-output}" DESTINATION "${opentrack-i18n-pfx}" RENAME "${i}.qm" ${opentrack-perms}) + endif() endforeach() add_custom_target(i18n DEPENDS ${all-deps}) endfunction() |