snorenotify/lang/CMakeLists.txt

27 lines
996 B
CMake
Raw Normal View History

2015-03-26 14:56:05 +00:00
set(LIBSNORE_LANGS de en)
set(TS_FILES )
set( snore_i18n_content "<!DOCTYPE RCC><RCC version=\"1.0\">\n<qresource prefix=\"/lang/libsnore\">\n" )
foreach( lang ${LIBSNORE_LANGS} )
list(APPEND TS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${lang}.ts)
set( snore_i18n_content "${snore_i18n_content}<file>${lang}.qm</file>\n" )
endforeach()
set( snore_i18n_content "${snore_i18n_content}</qresource>\n</RCC>\n" )
2015-07-24 09:20:46 +00:00
file( WRITE ${CMAKE_BINARY_DIR}/lang/snore_i18n.qrc.in "${snore_i18n_content}" )
2015-03-26 14:56:05 +00:00
qt5_add_translation(libsnore_lang ${TS_FILES})
2015-07-24 09:20:46 +00:00
add_custom_command(OUTPUT snore_i18n.qrc
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${CMAKE_BINARY_DIR}/lang/snore_i18n.qrc.in ${CMAKE_BINARY_DIR}/lang/snore_i18n.qrc
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
add_custom_target(libsnore_lang_translation ALL DEPENDS ${libsnore_lang} DEPENDS snore_i18n.qrc)
2015-07-23 23:58:46 +00:00
set(SNORE_RCS ${SNORE_RCS} ${CMAKE_BINARY_DIR}/lang/snore_i18n.qrc PARENT_SCOPE)