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