summaryrefslogtreecommitdiffhomepage
path: root/cmake/opentrack-i18n.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/opentrack-i18n.cmake')
-rw-r--r--cmake/opentrack-i18n.cmake20
1 files changed, 6 insertions, 14 deletions
diff --git a/cmake/opentrack-i18n.cmake b/cmake/opentrack-i18n.cmake
index 3d384595..bc468e8a 100644
--- a/cmake/opentrack-i18n.cmake
+++ b/cmake/opentrack-i18n.cmake
@@ -11,13 +11,13 @@ function(otr_i18n_for_target_directory n)
add_custom_command(OUTPUT "${t2}"
COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_SOURCE_DIR}/lang"
COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/lang"
- COMMAND "${lupdate-binary}" .
+ COMMAND "${lupdate-binary}"
-I "${CMAKE_SOURCE_DIR}"
-silent
-recursive
-no-obsolete
-locations none
- -no-ui-lines
+ .
-ts "${t}"
COMMAND "${CMAKE_COMMAND}" -E copy "${t}" "${t2}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
@@ -48,23 +48,15 @@ function(otr_merge_translations)
set(qm-output "${CMAKE_CURRENT_BINARY_DIR}/${i}.qm")
list(APPEND all-qm-files "${qm-output}")
+
add_custom_command(OUTPUT "${qm-output}"
COMMAND "${lrelease-binary}" -nounfinished -silent ${ts-files} -qm "${qm-output}"
DEPENDS ${ts-files}
COMMENT "Running lrelease for ${i}")
- otr_escape_string(esc-qm-output "${qm-output}")
- otr_escape_string(esc-i18n-pfx "${opentrack-i18n-pfx}")
- otr_escape_string(esc-perms "${opentrack-perms-file}")
- # this is because with i18n update disabled,
- # the file may not exist when running `make i18n-lang-foo_FOO'
- install(CODE "
- if(EXISTS \"${esc-qm-output}\")
- file(INSTALL \"${esc-qm-output}\"
- DESTINATION \"${esc-i18n-pfx}\"
- FILE_PERMISSIONS ${esc-perms})
- endif()
- ")
+ install(FILES "${qm-output}"
+ DESTINATION "${CMAKE_INSTALL_PREFIX}/${opentrack-i18n-pfx}"
+ PERMISSIONS ${opentrack-perms-file})
endforeach()
add_custom_target(i18n ALL DEPENDS ${all-qm-files})