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