+ # Generate the final translation files (.qm) for use by Qt
+ add_custom_command(VERBATIM
+ COMMENT "Compressing translations"
+ COMMAND $<TARGET_FILE:Qt5::lrelease> -silent ${tsfiles}
+ DEPENDS tsfiles.depends
+ OUTPUT ${qmfiles}
+ )
+
+ # Curate the language list and give diagnostic output
+ list(REMOVE_DUPLICATES linguas)
+ list(SORT linguas)
+ string(REPLACE ";" ", " linguas_string "${linguas}")
+ message(STATUS "Enabling translations for: ${linguas_string}")
+ else()
+ message(STATUS "No translations enabled")
+ endif()
+else()
+ message(WARNING "Qt Linguist Tools not found, you won't have translations!")
+endif()
+
+# Always generate translations
+add_custom_target(translations ALL DEPENDS ${qmfiles})
+
+if (EMBED_DATA)
+ quassel_add_resource(I18n PREFIX i18n BASEDIR ${CMAKE_CURRENT_BINARY_DIR} PATTERNS ${qmfiles} DEPENDS translations)
+else()
+ install(FILES ${qmfiles} DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/translations)
+endif()