Debian Codegraph @

po/po.pro

raw
1 TEMPLATE = aux
2
3 PROJECTNAME = lomiri-ui-toolkit
4
5 SOURCECODE = `find .. -name *.qml`
6
7 message("")
8 message(" Project Name: $$PROJECTNAME ")
9 message(" Source Code: $$SOURCECODE ")
10 message("")
11 message(" run 'make pot' to generate the pot file from source code. ")
12 message(" run 'qmake; make install' to install the mo files. ")
13 message("")
14
15 ## generate pot file 'make pot'
16 potfile.target = pot
17 potfile.commands = cd $$PWD; $$PWD/update-pot.sh lomiri-ui-toolkit $$PWD/../modules .;
18 QMAKE_EXTRA_TARGETS += potfile
19
20 ## generate pot file for gallery
21 potfile.commands += cd $$PWD; $$PWD/update-pot.sh lomiri-ui-toolkit-gallery $$PWD/../examples/lomiri-ui-toolkit-gallery $$PWD/../examples/lomiri-ui-toolkit-gallery/po;
22
23 ## Installation steps for mo files. 'make install'
24 MO_FILES = $$files(*.po)
25
26 message($$MO_FILES)
27
28 install_mo_commands =
29 for(po_file, MO_FILES) {
30 mo_file = $$replace(po_file,.po,.mo)
31 system(msgfmt $$po_file -o $$mo_file)
32 mo_name = $$replace(mo_file,.mo,)
33 mo_targetpath = $(INSTALL_ROOT)$$[QT_INSTALL_PREFIX]/share/locale/$${mo_name}/LC_MESSAGES
34 mo_target = $${mo_targetpath}/lomiri-ui-toolkit.mo
35 !isEmpty(install_mo_commands): install_mo_commands += &&
36 install_mo_commands += test -d $$mo_targetpath || mkdir -p $$mo_targetpath
37 install_mo_commands += && cp $${PWD}/$$mo_file $$mo_target
38 }
39
40 install.commands = $$install_mo_commands
41
42 QMAKE_EXTRA_TARGETS += install
43