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