mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-06 20:23:08 +00:00
chore(CMakeLists.txt): remove CR in translation files on windows
This commit is contained in:
parent
bb704cbeed
commit
cb31880cba
3 changed files with 22 additions and 4 deletions
|
|
@ -227,7 +227,8 @@ foreach (line ${QRC_RESOURCES_CONTENT})
|
|||
"^[ \t]*<[ \t]*file[ \t]*>[ \t]*(.+\\.[a-z]+)[ \t]*<[ \t]*/[ \t]*file[ \t]*>[ \t]*$"
|
||||
"\\1"
|
||||
result
|
||||
${line})
|
||||
"${line}"
|
||||
)
|
||||
string(REGEX MATCH "\\.[a-z]+$" isUi ${result})
|
||||
if (NOT ${isUi} STREQUAL "")
|
||||
list(APPEND QML_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${result}")
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
# This line prevent `.ts` files deletion.
|
||||
# See: https://bugreports.qt.io/browse/QTBUG-31860
|
||||
#
|
||||
# On October 17, 2016, this issue is marked `invalid` but it's a
|
||||
# On October 17, 2016, this issue was marked `invalid` but it's a
|
||||
# bullshit. It's not tolerated to remove sources files.
|
||||
set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM true)
|
||||
|
||||
|
|
@ -26,8 +26,13 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${I18N_FILENAME}" "${I18N_CONTENT}")
|
|||
|
||||
# Create `qm` files from `ts` files.
|
||||
qt5_create_translation(QM_FILES ${TS_FILES} ${SOURCES} ${HEADERS} ${QML_SOURCES} OPTIONS -no-obsolete)
|
||||
# Translations target must be called by `make`|`make all`.
|
||||
add_custom_target(update_translations DEPENDS ${QM_FILES})
|
||||
|
||||
# Update translations.
|
||||
add_custom_target(update_translations
|
||||
COMMAND ${CMAKE_COMMAND} "-DLANGUAGES=\"${LANGUAGES}\"" -P "${CMAKE_CURRENT_SOURCE_DIR}/clean_translations.cmake"
|
||||
DEPENDS ${QM_FILES}
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
)
|
||||
|
||||
# Remove `*.qm` when `clean` is called.
|
||||
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${QM_FILES}")
|
||||
|
|
|
|||
12
assets/languages/clean_translations.cmake
Normal file
12
assets/languages/clean_translations.cmake
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# ==============================================================================
|
||||
# assets/languages/clean_translations.cmake
|
||||
# ==============================================================================
|
||||
|
||||
if (WIN32)
|
||||
foreach (lang ${LANGUAGES})
|
||||
file(READ "${lang}.ts" content)
|
||||
set(cleanedContent)
|
||||
string(REPLACE "\r" "" cleanedContent "${content}")
|
||||
file(WRITE "${lang}.ts" "${cleanedContent}")
|
||||
endforeach ()
|
||||
endif ()
|
||||
Loading…
Add table
Reference in a new issue