Merge player-only option into swaroop variant.
[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     if bld.env.VARIANT != "swaroop":
39         for t in ['dcpomatic_cli', 'dcpomatic_server_cli', 'server_test', 'dcpomatic_kdm_cli', 'dcpomatic_create']:
40             obj = bld(features='cxx cxxprogram')
41             obj.uselib = uselib
42             obj.includes = ['..']
43             obj.use    = ['libdcpomatic2']
44             obj.source = '%s.cc' % t
45             obj.target = t.replace('dcpomatic', 'dcpomatic2')
46             if t == 'server_test':
47                 obj.install_path = None
48
49     gui_tools = []
50     if not bld.env.DISABLE_GUI:
51         if bld.env.VARIANT == 'swaroop':
52             gui_tools = ['dcpomatic_player']
53         else:
54             gui_tools = ['dcpomatic', 'dcpomatic_batch', 'dcpomatic_server', 'dcpomatic_kdm', 'dcpomatic_player']
55
56     for t in gui_tools:
57         obj = bld(features='cxx cxxprogram')
58         obj.uselib = uselib
59         if bld.env.BUILD_STATIC or bld.env.TARGET_LINUX:
60             obj.uselib += ' GTK'
61         obj.uselib += ' WXWIDGETS'
62         obj.includes = ['..']
63         obj.use    = ['libdcpomatic2', 'libdcpomatic2-wx']
64         obj.source = '%s.cc' % t
65         if bld.env.TARGET_WINDOWS:
66             obj.source += ' ../../platform/windows/%s.rc' % t
67         obj.target = t.replace('dcpomatic', 'dcpomatic2')
68
69     i18n.po_to_mo(os.path.join('src', 'tools'), 'dcpomatic2', bld)
70
71 def pot(bld):
72     i18n.pot(os.path.join('src', 'tools'), 'dcpomatic.cc dcpomatic_batch.cc dcpomatic_kdm.cc dcpomatic_server.cc dcpomatic_player.cc', 'dcpomatic')
73
74 def pot_merge(bld):
75     i18n.pot_merge(os.path.join('src', 'tools'), 'dcpomatic')