Merge 1.0 in.
[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_panel.cc
11           audio_plot.cc
12           cinema_dialog.cc
13           colour_conversion_editor.cc
14           config_dialog.cc
15           content_colour_conversion_dialog.cc
16           content_menu.cc
17           dci_metadata_dialog.cc
18           dir_picker_ctrl.cc
19           film_editor.cc
20           film_editor_panel.cc
21           film_viewer.cc
22           filter_dialog.cc
23           filter_editor.cc
24           gain_calculator_dialog.cc
25           job_manager_view.cc
26           job_wrapper.cc
27           kdm_dialog.cc
28           new_film_dialog.cc
29           preset_colour_conversion_dialog.cc
30           properties_dialog.cc
31           repeat_dialog.cc
32           screen_dialog.cc
33           server_dialog.cc
34           subtitle_panel.cc
35           timecode.cc
36           timeline.cc
37           timeline_dialog.cc
38           timing_panel.cc
39           video_panel.cc
40           wx_util.cc
41           wx_ui_signaller.cc
42           """
43
44 def configure(conf):
45     args = '--cppflags --cxxflags'
46     if not conf.env.STATIC:
47         args += ' --libs'
48
49     conf.check_cfg(msg='Checking for wxWidgets', package='', path=conf.options.wx_config, args=args,
50                    uselib_store='WXWIDGETS', mandatory=True)
51
52     if conf.env.STATIC:
53         # wx-config returns its static libraries as full paths, without -l prefixes, which confuses
54         # check_cfg(), so just hard-code it all.
55         conf.env.STLIB_WXWIDGETS = ['wx_gtk2u_xrc-2.9', 'wx_gtk2u_qa-2.9', 'wx_baseu_net-2.9', 'wx_gtk2u_html-2.9',
56                                     'wx_gtk2u_adv-2.9', 'wx_gtk2u_core-2.9', 'wx_baseu_xml-2.9', 'wx_baseu-2.9']
57         conf.env.LIB_WXWIDGETS = ['tiff', 'SM', 'dl', 'jpeg', 'png', 'X11']
58  
59     conf.in_msg = 1
60     wx_version = conf.check_cfg(package='', path=conf.options.wx_config, args='--version').strip()
61     conf.im_msg = 0
62     if wx_version != '2.9.4' and wx_version != '2.9.5':
63         conf.fatal('wxwidgets version 2.9.4 or 2.9.5 is required; %s found' % wx_version)
64
65 def build(bld):
66     if bld.env.STATIC:
67         obj = bld(features = 'cxx cxxstlib')
68     else:
69         obj = bld(features = 'cxx cxxshlib')
70
71     obj.name   = 'libdcpomatic-wx'
72 #    obj.includes = [ '..' ]
73     obj.export_includes = ['..']
74     obj.uselib = 'WXWIDGETS'
75     if bld.env.TARGET_LINUX:
76         obj.uselib += ' GTK'
77     obj.use = 'libdcpomatic'
78     obj.source = sources
79     obj.target = 'dcpomatic-wx'
80
81     i18n.po_to_mo(os.path.join('src', 'wx'), 'libdcpomatic-wx', bld)
82
83 def pot(bld):
84     i18n.pot(os.path.join('src', 'wx'), sources, 'libdcpomatic-wx')
85
86 def pot_merge(bld):
87     i18n.pot_merge(os.path.join('src', 'wx'), 'libdcpomatic-wx')