c46321f1cf2119ab86354d5cf6370bf5edc09557
[dcpomatic.git] / src / wx / wscript
1 import os
2 import glob
3 from waflib import Logs
4 import i18n
5
6 sources = """
7           about_dialog.cc
8           audio_dialog.cc
9           audio_mapping_view.cc
10           audio_plot.cc
11           config_dialog.cc
12           content_menu.cc
13           dci_metadata_dialog.cc
14           dir_picker_ctrl.cc
15           film_editor.cc
16           film_viewer.cc
17           filter_dialog.cc
18           filter_view.cc
19           gain_calculator_dialog.cc
20           job_manager_view.cc
21           job_wrapper.cc
22           new_film_dialog.cc
23           properties_dialog.cc
24           repeat_dialog.cc
25           server_dialog.cc
26           timecode.cc
27           timeline.cc
28           timeline_dialog.cc
29           wx_util.cc
30           wx_ui_signaller.cc
31           """
32
33 def configure(conf):
34     args = '--cppflags --cxxflags'
35     if not conf.env.STATIC:
36         args += ' --libs'
37
38     conf.check_cfg(msg='Checking for wxWidgets', package='', path=conf.options.wx_config, args=args,
39                    uselib_store='WXWIDGETS', mandatory=True)
40
41     if conf.env.STATIC:
42         # wx-config returns its static libraries as full paths, without -l prefixes, which confuses
43         # check_cfg(), so just hard-code it all.
44         conf.env.STLIB_WXWIDGETS = ['wx_gtk2u_xrc-2.9', 'wx_gtk2u_qa-2.9', 'wx_baseu_net-2.9', 'wx_gtk2u_html-2.9',
45                                     'wx_gtk2u_adv-2.9', 'wx_gtk2u_core-2.9', 'wx_baseu_xml-2.9', 'wx_baseu-2.9']
46         conf.env.LIB_WXWIDGETS = ['tiff', 'SM', 'dl', 'jpeg', 'png', 'X11']
47  
48     conf.in_msg = 1
49     wx_version = conf.check_cfg(package='', path=conf.options.wx_config, args='--version').strip()
50     conf.im_msg = 0
51     if wx_version != '2.9.4':
52         conf.fatal('wxwidgets version 2.9.4 is required; %s found' % wx_version)
53
54 def build(bld):
55     if bld.env.STATIC:
56         obj = bld(features = 'cxx cxxstlib')
57     else:
58         obj = bld(features = 'cxx cxxshlib')
59
60     obj.name   = 'libdcpomatic-wx'
61 #    obj.includes = [ '..' ]
62     obj.export_includes = ['..']
63     obj.uselib = 'WXWIDGETS'
64     if bld.env.TARGET_LINUX:
65         obj.uselib += ' GTK'
66     obj.use = 'libdcpomatic'
67     obj.source = sources
68     obj.target = 'dcpomatic-wx'
69
70     i18n.po_to_mo(os.path.join('src', 'wx'), 'libdcpomatic-wx', bld)
71
72 def pot(bld):
73     i18n.pot(os.path.join('src', 'wx'), sources, 'libdcpomatic-wx')
74
75 def pot_merge(bld):
76     i18n.pot_merge(os.path.join('src', 'wx'), 'libdcpomatic-wx')