2015-07-28 00:05:16 +00:00
|
|
|
find_package(Qt5LinguistTools QUIET)
|
|
|
|
set_package_properties(Qt5LinguistTools PROPERTIES
|
|
|
|
PURPOSE "Support for translations."
|
|
|
|
TYPE OPTIONAL)
|
2015-03-26 14:56:05 +00:00
|
|
|
|
2015-07-28 00:05:16 +00:00
|
|
|
|
|
|
|
if(Qt5LinguistTools_FOUND)
|
|
|
|
set(LIBSNORE_LANGS de en)
|
2015-03-26 14:56:05 +00:00
|
|
|
|
2015-07-28 00:05:16 +00:00
|
|
|
set(TS_FILES )
|
2015-07-28 10:17:05 +00:00
|
|
|
set( snore_i18n_content "" )
|
2015-07-28 00:05:16 +00:00
|
|
|
foreach( lang ${LIBSNORE_LANGS} )
|
|
|
|
list(APPEND TS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${lang}.ts)
|
2015-07-28 10:17:05 +00:00
|
|
|
set( snore_i18n_content "${snore_i18n_content}\n\t\t<file>${lang}.qm</file>" )
|
2015-07-28 00:05:16 +00:00
|
|
|
endforeach()
|
2015-06-23 15:04:57 +00:00
|
|
|
|
2015-07-28 09:46:38 +00:00
|
|
|
QT5_CREATE_TRANSLATION(libsnore_lang ${TS_FILES} ${PROJECT_SOURCE_DIR}/src)
|
2015-03-26 14:56:05 +00:00
|
|
|
|
|
|
|
|
2015-07-28 10:17:05 +00:00
|
|
|
configure_file(snore_i18n.qrc.in snore_i18n.qrc @ONLY)
|
|
|
|
add_custom_target(libsnore_lang_translation ALL DEPENDS ${libsnore_lang})
|
2015-07-24 09:20:46 +00:00
|
|
|
|
2015-07-23 23:58:46 +00:00
|
|
|
|
2015-07-28 00:05:16 +00:00
|
|
|
set(SNORE_RCS ${SNORE_RCS} ${CMAKE_BINARY_DIR}/lang/snore_i18n.qrc PARENT_SCOPE)
|
|
|
|
endif()
|