From 0c2135d90b326d07683c616dffe6ad1e94aaacbf Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 8 Dec 2016 06:23:21 +0100 Subject: cmake: fix translations always updating --- cmake/opentrack-boilerplate.cmake | 2 +- cmake/opentrack-install.cmake | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'cmake') diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake index 82c277c5..9393eae4 100644 --- a/cmake/opentrack-boilerplate.cmake +++ b/cmake/opentrack-boilerplate.cmake @@ -220,7 +220,7 @@ function(opentrack_boilerplate n) set(langs "") foreach(i ${opentrack-all-translations}) set(t "${CMAKE_CURRENT_SOURCE_DIR}/lang/${i}.ts") - if(SDK_REGEN_TRANSLATIONS OR NOT EXISTS t) + if(SDK_REGEN_TRANSLATIONS OR NOT EXISTS "${t}") list(APPEND langs "${t}") get_property(tt GLOBAL PROPERTY opentrack-${i}-ts) set(tt ${tt} ${t}) diff --git a/cmake/opentrack-install.cmake b/cmake/opentrack-install.cmake index 9fc280d6..3406007b 100644 --- a/cmake/opentrack-install.cmake +++ b/cmake/opentrack-install.cmake @@ -65,10 +65,13 @@ function(merge_translations) list(APPEND deps "i18n-module-${k}") endforeach() - add_custom_target(i18n-lang-${i} - COMMAND "${Qt5_DIR}/../../../bin/lrelease" -nounfinished -silent ${ts} -qm "${qm-output}" - DEPENDS ${deps} - ) + if(NOT "${ts}" STREQUAL "") + add_custom_target(i18n-lang-${i} + COMMAND "${Qt5_DIR}/../../../bin/lrelease" -nounfinished -silent ${ts} -qm "${qm-output}" + DEPENDS ${deps}) + else() + add_custom_target(i18n-lang-${i} DEPENDS ${deps}) + endif() list(APPEND all-deps "i18n-lang-${i}") install(FILES "${qm-output}" DESTINATION "${opentrack-i18n-pfx}" RENAME "${i}.qm" ${opentrack-perms}) endforeach() -- cgit v1.2.3