summaryrefslogtreecommitdiff
path: root/src/tools/wscript
blob: 016e50d5a5876b24bc76d948b35c1fb507a44dd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#
#    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
#
#    This file is part of DCP-o-matic.
#
#    DCP-o-matic is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    DCP-o-matic is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
#

import os
import glob
from waflib import Logs
import i18n

def configure(conf):
    if conf.env.TARGET_WINDOWS:
        conf.env.append_value('CXXFLAGS', ['-mconsole'])
        conf.env.append_value('LINKFLAGS', ['-mconsole'])

def build(bld):
    uselib =  'BOOST_THREAD BOOST_DATETIME DCP XMLSEC CXML XMLPP AVFORMAT AVFILTER AVCODEC '
    uselib += 'AVUTIL SWSCALE SWRESAMPLE POSTPROC CURL BOOST_FILESYSTEM SSH ZIP CAIROMM FONTCONFIG PANGOMM SUB '
    uselib += 'MAGICK SNDFILE SAMPLERATE BOOST_REGEX ICU NETTLE RTAUDIO '

    if bld.env.TARGET_WINDOWS:
        uselib += 'WINSOCK2 DBGHELP SHLWAPI MSWSOCK BOOST_LOCALE WINSOCK2 OLE32 DSOUND WINMM KSUSER '

    for t in ['dcpomatic_cli', 'dcpomatic_server_cli', 'server_test', 'dcpomatic_kdm_cli', 'dcpomatic_create']:
        obj = bld(features='cxx cxxprogram')
        obj.uselib = uselib
        obj.includes = ['..']
        obj.use    = ['libdcpomatic2']
        obj.source = '%s.cc' % t
        obj.target = t.replace('dcpomatic', 'dcpomatic2')
        if t == 'server_test':
            obj.install_path = None

    if not bld.env.DISABLE_GUI:
        for t in ['dcpomatic', 'dcpomatic_batch', 'dcpomatic_server', 'dcpomatic_kdm', 'dcpomatic_player']:
            obj = bld(features='cxx cxxprogram')
            obj.uselib = uselib
            if bld.env.BUILD_STATIC or bld.env.TARGET_LINUX:
                obj.uselib += ' GTK'
            obj.uselib += ' WXWIDGETS'
            obj.includes = ['..']
            obj.use    = ['libdcpomatic2', 'libdcpomatic2-wx']
            obj.source = '%s.cc' % t
            if bld.env.TARGET_WINDOWS:
                obj.source += ' ../../platform/windows/%s.rc' % t
            obj.target = t.replace('dcpomatic', 'dcpomatic2')

        i18n.po_to_mo(os.path.join('src', 'tools'), 'dcpomatic2', bld)

def pot(bld):
    i18n.pot(os.path.join('src', 'tools'), 'dcpomatic.cc dcpomatic_batch.cc dcpomatic_kdm.cc dcpomatic_server.cc dcpomatic_player.cc', 'dcpomatic')

def pot_merge(bld):
    i18n.pot_merge(os.path.join('src', 'tools'), 'dcpomatic')