snorenotify/lang/CMakeLists.txt

26 lines
873 B
CMake
Raw Normal View History

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 )
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)
set( snore_i18n_content "${snore_i18n_content}\n\t\t<file>${lang}.qm</file>" )
2015-07-28 00:05:16 +00:00
endforeach()
QT5_CREATE_TRANSLATION(libsnore_lang ${TS_FILES} ${PROJECT_SOURCE_DIR}/src)
2015-03-26 14:56: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()