summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xCMakeLists.txt2
-rw-r--r--cmake/opentrack-boilerplate.cmake2
-rw-r--r--cmake/opentrack-clean-build-directory.cmake2
-rw-r--r--cmake/opentrack-install.cmake18
-rw-r--r--cmake/opentrack-policy.cmake2
5 files changed, 14 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f6718bf5..eee0e4c3 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,7 +31,7 @@ include(opentrack-policy NO_POLICY_SCOPE)
set_property(GLOBAL PROPERTY opentrack-all-modules "")
set_property(GLOBAL PROPERTY opentrack-all-source-dirs "")
-set(opentrack-all-translations nl_NL ru_RU stub)
+set(opentrack_all-translations "nl_NL;ru_RU;stub" CACHE STRING "")
include(opentrack-word-size)
include(opentrack-hier)
diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake
index 022bfdd7..d9b011ee 100644
--- a/cmake/opentrack-boilerplate.cmake
+++ b/cmake/opentrack-boilerplate.cmake
@@ -108,7 +108,7 @@ endfunction()
function(otr_i18n_for_target_directory n)
set(k "opentrack-${n}")
- foreach(i ${opentrack-all-translations})
+ foreach(i ${opentrack_all-translations})
set(t "${CMAKE_CURRENT_SOURCE_DIR}/lang/${i}.ts")
add_custom_command(OUTPUT "${t}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_SOURCE_DIR}/lang"
diff --git a/cmake/opentrack-clean-build-directory.cmake b/cmake/opentrack-clean-build-directory.cmake
index c0934af1..f531a6cb 100644
--- a/cmake/opentrack-clean-build-directory.cmake
+++ b/cmake/opentrack-clean-build-directory.cmake
@@ -1,4 +1,4 @@
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
-include(opentrack-build)
+include(opentrack-mrproper)
cleanup_build_dir()
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()
diff --git a/cmake/opentrack-policy.cmake b/cmake/opentrack-policy.cmake
index 7ded20f7..98f504a1 100644
--- a/cmake/opentrack-policy.cmake
+++ b/cmake/opentrack-policy.cmake
@@ -1,4 +1,4 @@
-foreach(k CMP0020 CMP0058 CMP0028 CMP0042 CMP0063 CMP0053 CMP0011 CMP0054)
+foreach(k CMP0020 CMP0022 CMP0058 CMP0028 CMP0042 CMP0063 CMP0053 CMP0011 CMP0054)
if(POLICY ${k})
cmake_policy(SET ${k} NEW)
endif()