boost exception test.
[dcpomatic.git] / src / tools / wscript
1 #
2 #    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
3 #
4 #    This file is part of DCP-o-matic.
5 #
6 #    DCP-o-matic is free software; you can redistribute it and/or modify
7 #    it under the terms of the GNU General Public License as published by
8 #    the Free Software Foundation; either version 2 of the License, or
9 #    (at your option) any later version.
10 #
11 #    DCP-o-matic is distributed in the hope that it will be useful,
12 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 #    GNU General Public License for more details.
15 #
16 #    You should have received a copy of the GNU General Public License
17 #    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
18 #
19
20 import os
21 import glob
22 from waflib import Logs
23 import i18n
24
25 def configure(conf):
26     if conf.env.TARGET_WINDOWS:
27         conf.env.append_value('CXXFLAGS', ['-mconsole'])
28         conf.env.append_value('LINKFLAGS', ['-mconsole'])
29
30 def build(bld):
31     uselib =  'BOOST_THREAD BOOST_DATETIME DCP XMLSEC CXML XMLPP AVFORMAT AVFILTER AVCODEC '
32     uselib += 'AVUTIL SWSCALE SWRESAMPLE POSTPROC CURL BOOST_FILESYSTEM SSH ZIP CAIROMM FONTCONFIG PANGOMM SUB '
33     uselib += 'SNDFILE SAMPLERATE BOOST_REGEX ICU NETTLE RTAUDIO PNG '
34
35     if bld.env.TARGET_WINDOWS:
36         uselib += 'WINSOCK2 DBGHELP SHLWAPI MSWSOCK BOOST_LOCALE WINSOCK2 OLE32 DSOUND WINMM KSUSER '
37
38     if bld.env.TARGET_LINUX:
39         uselib += 'DL'
40
41     cli_tools = []
42     if bld.env.VARIANT == 'swaroop-theater':
43         cli_tools = [ 'dcpomatic_uuid']
44     elif bld.env.VARIANT == "swaroop-studio":
45         cli_tools = ['dcpomatic_cli', 'dcpomatic_server_cli', 'server_test', 'dcpomatic_kdm_cli', 'dcpomatic_create', 'dcpomatic_ecinema', 'dcpomatic_uuid']
46     else:
47         cli_tools = ['dcpomatic_cli', 'dcpomatic_server_cli', 'server_test', 'dcpomatic_kdm_cli', 'dcpomatic_create']
48
49     for t in cli_tools:
50         obj = bld(features='cxx cxxprogram')
51         obj.uselib = uselib
52         obj.includes = ['..']
53         obj.use    = ['libdcpomatic2']
54         obj.source = '%s.cc' % t
55         obj.target = t.replace('dcpomatic', 'dcpomatic2')
56         if t == 'server_test':
57             obj.install_path = None
58
59     gui_tools = []
60     if not bld.env.DISABLE_GUI:
61         if bld.env.VARIANT == 'swaroop-theater':
62             gui_tools = ['dcpomatic_player', 'dcpomatic_playlist']
63         else:
64             gui_tools = ['dcpomatic', 'dcpomatic_batch', 'dcpomatic_server', 'dcpomatic_kdm', 'dcpomatic_player', 'dcpomatic_playlist']
65
66     for t in gui_tools:
67         obj = bld(features='cxx cxxprogram')
68         obj.uselib = uselib
69         if bld.env.BUILD_STATIC or bld.env.TARGET_LINUX:
70             obj.uselib += ' GTK'
71         obj.uselib += ' WXWIDGETS'
72         if not bld.env.TARGET_OSX:
73             obj.uselib += ' GL GLU'
74         if bld.env.TARGET_LINUX:
75             obj.uselib += ' X11'
76         obj.includes = ['..']
77         obj.use    = ['libdcpomatic2', 'libdcpomatic2-wx']
78         obj.source = '%s.cc' % t
79         if bld.env.TARGET_WINDOWS:
80             obj.source += ' ../../platform/windows/%s.rc' % t
81         obj.target = t.replace('dcpomatic', 'dcpomatic2')
82
83     i18n.po_to_mo(os.path.join('src', 'tools'), 'dcpomatic2', bld)
84
85 def pot(bld):
86     i18n.pot(os.path.join('src', 'tools'), 'dcpomatic.cc dcpomatic_batch.cc dcpomatic_kdm.cc dcpomatic_server.cc dcpomatic_player.cc dcpomatic_playlist.cc', 'dcpomatic')
87
88 def pot_merge(bld):
89     i18n.pot_merge(os.path.join('src', 'tools'), 'dcpomatic')