~pkunal-parmar/ubuntu-calendar-app/ICalImport

« back to all changes in this revision

Viewing changes to po/CMakeLists.txt

  • Committer: Sergio Schvezov
  • Date: 2014-01-18 23:29:11 UTC
  • mto: This revision was merged to the branch mainline in revision 184.
  • Revision ID: sergio.schvezov@canonical.com-20140118232911-p3jdkkomszdl2l70
Adding cmake 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
include(FindGettext)
 
2
find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext)
 
3
 
 
4
set(DOMAIN ${PROJECT_NAME})
 
5
set(POT_FILE ${DOMAIN}.pot)
 
6
file(GLOB PO_FILES *.po)
 
7
 
 
8
add_custom_target(${POT_FILE}
 
9
                  COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE}
 
10
                          -D ${CMAKE_SOURCE_DIR}
 
11
                          --from-code=UTF-8
 
12
                          --c++ --qt --add-comments=TRANSLATORS
 
13
                          --keyword=tr --keyword=tr:1,2
 
14
                                                  --package-name='${PROJECT}'
 
15
                          --copyright-holder='Canonical Ltd.'
 
16
                          ${I18N_SRC_FILES})
 
17
 
 
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}
 
24
            RENAME ${DOMAIN}.mo)
 
25
endforeach(PO_FILE)