Commit e70c0779 authored by Ronan Abhamon's avatar Ronan Abhamon

fix(CMakeLists): supports new cmake versions for qm translations

parent 9898c43c
...@@ -27,6 +27,13 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${I18N_FILENAME}" "${I18N_CONTENT}") ...@@ -27,6 +27,13 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${I18N_FILENAME}" "${I18N_CONTENT}")
# Create `qm` files from `ts` files. # Create `qm` files from `ts` files.
qt5_create_translation(QM_FILES ${TS_FILES} ${SOURCES} ${HEADERS} ${QML_SOURCES} OPTIONS -no-obsolete) qt5_create_translation(QM_FILES ${TS_FILES} ${SOURCES} ${HEADERS} ${QML_SOURCES} OPTIONS -no-obsolete)
# Workaround: Create empty files for some cmake versions. Otherwise, the qm rules can't be used.
foreach (qm ${QM_FILES})
if (NOT EXISTS "${qm}")
file(GENERATE OUTPUT "${qm}" CONTENT "")
endif ()
endforeach ()
# Update translations. # Update translations.
add_custom_target(update_translations add_custom_target(update_translations
COMMAND ${CMAKE_COMMAND} "-DLANGUAGES=\"${LANGUAGES}\"" -P "${CMAKE_CURRENT_SOURCE_DIR}/clean_translations.cmake" COMMAND ${CMAKE_COMMAND} "-DLANGUAGES=\"${LANGUAGES}\"" -P "${CMAKE_CURRENT_SOURCE_DIR}/clean_translations.cmake"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment