Stub player.
[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 += 'MAGICK SNDFILE SAMPLERATE BOOST_REGEX ICU NETTLE RTAUDIO '
34
35     if bld.env.TARGET_WINDOWS:
36         uselib += 'WINSOCK2 DBGHELP SHLWAPI MSWSOCK BOOST_LOCALE WINSOCK2 OLE32 DSOUND WINMM KSUSER '
37
38     for t in ['dcpomatic_cli', 'dcpomatic_server_cli', 'server_test', 'dcpomatic_kdm_cli', 'dcpomatic_create']:
39         obj = bld(features='cxx cxxprogram')
40         obj.uselib = uselib
41         obj.includes = ['..']
42         obj.use    = ['libdcpomatic2']
43         obj.source = '%s.cc' % t
44         obj.target = t.replace('dcpomatic', 'dcpomatic2')
45         if t == 'server_test':
46             obj.install_path = None
47
48     if not bld.env.DISABLE_GUI:
49         for t in ['dcpomatic', 'dcpomatic_batch', 'dcpomatic_server', 'dcpomatic_kdm', 'dcpomatic_player']:
50             obj = bld(features='cxx cxxprogram')
51             obj.uselib = uselib
52             if bld.env.BUILD_STATIC or bld.env.TARGET_LINUX:
53                 obj.uselib += ' GTK'
54             obj.uselib += ' WXWIDGETS'
55             obj.includes = ['..']
56             obj.use    = ['libdcpomatic2', 'libdcpomatic2-wx']
57             obj.source = '%s.cc' % t
58             if bld.env.TARGET_WINDOWS:
59                 obj.source += ' ../../platform/windows/%s.rc' % t
60             obj.target = t.replace('dcpomatic', 'dcpomatic2')
61
62         i18n.po_to_mo(os.path.join('src', 'tools'), 'dcpomatic2', bld)
63
64 def pot(bld):
65     i18n.pot(os.path.join('src', 'tools'), 'dcpomatic.cc dcpomatic_batch.cc dcpomatic_kdm.cc dcpomatic_server.cc', 'dcpomatic')
66
67 def pot_merge(bld):
68     i18n.pot_merge(os.path.join('src', 'tools'), 'dcpomatic')