2
find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext)
4
set(DOMAIN ${PROJECT_NAME})
5
set(POT_FILE ${DOMAIN}.pot)
6
file(GLOB PO_FILES *.po)
8
add_custom_target(${POT_FILE}
9
COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE}
10
-D ${CMAKE_SOURCE_DIR}
12
--c++ --qt --add-comments=TRANSLATORS
13
--keyword=tr --keyword=tr:1,2
14
--package-name='${PROJECT}'
15
--copyright-holder='Canonical Ltd.'
18
foreach(PO_FILE ${PO_FILES})
19
get_filename_component(LANG ${PO_FILE} NAME_WE)
20
gettext_process_po_files(${LANG} ALL PO_FILES ${PO_FILE})
21
set(INSTALL_DIR ${CMAKE_INSTALL_LOCALEDIR}/${LANG}/LC_MESSAGES)
22
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo
23
DESTINATION ${INSTALL_DIR}