Some i18n stuff.
[dcpomatic.git] / src / wx / wscript
1 import os
2 import glob
3 from waflib import Logs
4 import i18n
5
6 sources = """
7           config_dialog.cc
8           dci_metadata_dialog.cc
9           dir_picker_ctrl.cc
10           film_editor.cc
11           film_viewer.cc
12           filter_dialog.cc
13           filter_view.cc
14           gain_calculator_dialog.cc
15           job_manager_view.cc
16           job_wrapper.cc
17           new_film_dialog.cc
18           properties_dialog.cc
19           server_dialog.cc
20           wx_util.cc
21           wx_ui_signaller.cc
22           """
23
24 def configure(conf):
25     conf.check_cfg(package = '', path = conf.options.wx_config, args = '--cppflags --cxxflags --libs', uselib_store = 'WXWIDGETS', mandatory = True)
26
27 def build(bld):
28     if bld.env.STATIC:
29         obj = bld(features = 'cxx cxxstlib')
30     else:
31         obj = bld(features = 'cxx cxxshlib')
32
33     obj.name   = 'libdvdomatic-wx'
34     obj.includes = [ '..' ]
35     obj.export_includes = ['.']
36     obj.uselib = 'WXWIDGETS'
37     obj.use = 'libdvdomatic'
38     obj.source = sources
39     obj.target = 'dvdomatic-wx'
40
41 def pot(bld):
42     s = ""
43     for f in sources.split('\n'):
44         t = f.strip()
45         if len(t) > 0:
46             s += (os.path.join('src', 'wx', t)) + " "
47
48     os.system('xgettext -d libdvdomatic-wx -s --keyword=_ -p build/src/wx -o libdvdomatic-wx.pot %s' % s)
49
50 def mo(bld):
51     i18n.po_to_mo(os.path.join('src', 'wx'), 'libdvdomatic-wx')
52