Use a template for AssetReader.
[libdcp.git] / src / wscript
1 #
2 #    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
3 #
4 #    This program is free software; you can redistribute it and/or modify
5 #    it under the terms of the GNU General Public License as published by
6 #    the Free Software Foundation; either version 2 of the License, or
7 #    (at your option) any later version.
8 #
9 #    This program is distributed in the hope that it will be useful,
10 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 #    GNU General Public License for more details.
13 #
14 #    You should have received a copy of the GNU General Public License
15 #    along with this program; if not, write to the Free Software
16 #    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 #
18 #    In addition, as a special exception, the copyright holders give
19 #    permission to link the code of portions of this program with the
20 #    OpenSSL library under certain conditions as described in each
21 #    individual source file, and distribute linked combinations
22 #    including the two.
23 #
24 #    You must obey the GNU General Public License in all respects
25 #    for all of the code used other than OpenSSL.  If you modify
26 #    file(s) with this exception, you may extend this exception to your
27 #    version of the file(s), but you are not obligated to do so.  If you
28 #    do not wish to do so, delete this exception statement from your
29 #    version.  If you delete this exception statement from all source
30 #    files in the program, then also delete it here.
31 #
32
33 from waflib import TaskGen
34
35 def build(bld):
36     source = """
37              asset.cc
38              asset_writer.cc
39              atmos_asset.cc
40              certificate_chain.cc
41              certificate.cc
42              colour_conversion.cc
43              colour_matrix.cc
44              cpl.cc
45              data.cc
46              dcp.cc
47              dcp_time.cc
48              decrypted_kdm.cc
49              decryption_context.cc
50              decrypted_kdm_key.cc
51              encrypted_kdm.cc
52              encryption_context.cc
53              exceptions.cc
54              file.cc
55              font_asset.cc
56              gamma_transfer_function.cc
57              interop_load_font_node.cc
58              interop_subtitle_asset.cc
59              j2k.cc
60              key.cc
61              local_time.cc
62              locale_convert.cc
63              metadata.cc
64              modified_gamma_transfer_function.cc
65              mono_picture_asset.cc
66              mono_picture_asset_writer.cc
67              mono_picture_frame.cc
68              mxf.cc
69              name_format.cc
70              object.cc
71              openjpeg_image.cc
72              picture_asset.cc
73              picture_asset_writer.cc
74              raw_convert.cc
75              reel.cc
76              reel_asset.cc
77              reel_atmos_asset.cc
78              reel_mono_picture_asset.cc
79              reel_mxf.cc
80              reel_picture_asset.cc
81              reel_sound_asset.cc
82              reel_stereo_picture_asset.cc
83              reel_subtitle_asset.cc
84              ref.cc
85              rgb_xyz.cc
86              smpte_load_font_node.cc
87              smpte_subtitle_asset.cc
88              sound_asset.cc
89              sound_asset_writer.cc
90              stereo_picture_asset.cc
91              stereo_picture_asset_writer.cc
92              stereo_picture_frame.cc
93              subtitle_asset.cc
94              subtitle_string.cc
95              transfer_function.cc
96              types.cc
97              util.cc
98              version.cc
99              """
100
101     headers = """
102               asset.h
103               asset_reader.h
104               asset_writer.h
105               atmos_asset.h
106               certificate_chain.h
107               certificate.h
108               chromaticity.h
109               colour_conversion.h
110               colour_matrix.h
111               cpl.h
112               dcp.h
113               dcp_time.h
114               data.h
115               decrypted_kdm.h
116               decrypted_kdm_key.h
117               encrypted_kdm.h
118               encryption_context.h
119               exceptions.h
120               font_asset.h
121               gamma_transfer_function.h
122               interop_load_font_node.h
123               interop_subtitle_asset.h
124               j2k.h
125               key.h
126               load_font_node.h
127               local_time.h
128               locale_convert.h
129               metadata.h
130               mono_picture_asset.h
131               mono_picture_asset_reader.h
132               mono_picture_frame.h
133               modified_gamma_transfer_function.h
134               mxf.h
135               name_format.h
136               object.h
137               openjpeg_image.h
138               picture_asset.h
139               picture_asset_writer.h
140               raw_convert.h
141               rgb_xyz.h
142               reel.h
143               reel_asset.h
144               reel_atmos_asset.h
145               reel_mono_picture_asset.h
146               reel_mxf.h
147               reel_picture_asset.h
148               reel_sound_asset.h
149               reel_stereo_picture_asset.h
150               reel_subtitle_asset.h
151               ref.h
152               smpte_load_font_node.h
153               smpte_subtitle_asset.h
154               sound_frame.h
155               sound_asset.h
156               sound_asset_reader.h
157               sound_asset_writer.h
158               stereo_picture_asset.h
159               stereo_picture_asset_reader.h
160               stereo_picture_asset_writer.h
161               stereo_picture_frame.h
162               subtitle_asset.h
163               subtitle_string.h
164               transfer_function.h
165               types.h
166               util.h
167               version.h
168               """
169
170     # Main library
171     if bld.env.STATIC:
172         obj = bld(features='cxx cxxstlib')
173     else:
174         obj = bld(features='cxx cxxshlib')
175     obj.name = 'libdcp%s' % bld.env.API_VERSION
176     obj.target = 'dcp%s' % bld.env.API_VERSION
177     obj.export_includes = ['.']
178     obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1 ASDCPLIB_CTH'
179     obj.use = 'libkumu-libdcp%s libasdcp-libdcp%s' % (bld.env.API_VERSION, bld.env.API_VERSION)
180     obj.source = source
181
182     # Library for gcov
183     if bld.is_defined('HAVE_GCOV'):
184         obj = bld(features='cxx cxxstlib')
185         obj.name = 'libdcp%s_gcov' % bld.env.API_VERSION
186         obj.target = 'dcp%s_gcov' % bld.env.API_VERSION
187         obj.export_includes = ['.']
188         obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1 ASDCPLIB_CTH'
189         obj.use = 'libkumu-libdcp%s libasdcp-libdcp%s' % (bld.env.API_VERSION, bld.env.API_VERSION)
190         obj.source = source
191         obj.cppflags = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
192
193     bld.install_files('${PREFIX}/include/libdcp%s/dcp' % bld.env.API_VERSION, headers)
194     if bld.env.STATIC:
195         bld.install_files('${PREFIX}/lib', 'libdcp%s.a' % bld.env.API_VERSION)