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