diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-06-19 16:26:33 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-06-19 16:26:33 +0200 |
commit | 897c429175624964dded5daa8ce077b45a7a5107 (patch) | |
tree | 55991ed96eea8ef701713e421d269c676c594381 /cmake/opentrack-install.cmake | |
parent | b454c962f4784ed06908f668b66376600d21dc52 (diff) |
cmake: add cache variables
Diffstat (limited to 'cmake/opentrack-install.cmake')
-rw-r--r-- | cmake/opentrack-install.cmake | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/cmake/opentrack-install.cmake b/cmake/opentrack-install.cmake index 2f91ab55..750b47cf 100644 --- a/cmake/opentrack-install.cmake +++ b/cmake/opentrack-install.cmake @@ -47,35 +47,37 @@ otr_inst2("${opentrack-doc-src-pfx}" FILES "${CMAKE_SOURCE_DIR}/WARRANTY.txt") otr_inst2("${opentrack-doc-src-pfx}" FILES "${CMAKE_SOURCE_DIR}/OPENTRACK-LICENSING.txt") otr_inst2("${opentrack-doc-src-pfx}" FILES "${CMAKE_SOURCE_DIR}/AUTHORS.md") +set(opentrack_disable-i18n-update FALSE CACHE BOOL "") + function(merge_translations) install(CODE "file(REMOVE_RECURSE \"\${CMAKE_INSTALL_PREFIX}/i18n\")") set(all-qm-files "") - foreach(i ${opentrack-all-translations}) + foreach(i ${opentrack_all-translations}) get_property(ts-files GLOBAL PROPERTY "opentrack-ts-files-${i}") set(ts-files_ "") foreach(k ${ts-files}) - if(EXISTS "${k}") + if(EXISTS "${k}" OR NOT opentrack_disable-i18n-update) list(APPEND ts-files_ "${k}") endif() endforeach() - set(ts-files "${ts-files_}") + if (opentrack_disable-i18n-update) + set(ts-files_ "") + endif() - if(NOT ".${ts-files}" STREQUAL ".") + if(NOT ".${ts-files_}" STREQUAL ".") set(qm-output "${CMAKE_CURRENT_BINARY_DIR}/${i}.qm") list(APPEND all-qm-files "${qm-output}") add_custom_command(OUTPUT "${qm-output}" - COMMAND "${Qt5_DIR}/../../../bin/lrelease" -nounfinished -silent ${ts-files} -qm "${qm-output}" + COMMAND "${Qt5_DIR}/../../../bin/lrelease" -nounfinished -silent ${ts-files_} -qm "${qm-output}" DEPENDS ${ts-files} - COMMENT "Running lrelease for ${i}" - ) + COMMENT "Running lrelease for ${i}") set(lang-target "i18n-lang-${i}") add_custom_target("${lang-target}" DEPENDS "${qm-output}") - install(FILES "${qm-output}" DESTINATION "${opentrack-i18n-pfx}" RENAME "${i}.qm" ${opentrack-perms}) endif() endforeach() |