Basic writing of DCPs containing Atmos MXFs; untested.
[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
19 from waflib import TaskGen
20
21 def build(bld):
22     source = """
23              asset.cc
24              atmos_asset.cc
25              certificate_chain.cc
26              certificate.cc
27              colour_conversion.cc
28              colour_matrix.cc
29              cpl.cc
30              data.cc
31              dcp.cc
32              dcp_time.cc
33              decrypted_kdm.cc
34              decrypted_kdm_key.cc
35              encrypted_kdm.cc
36              exceptions.cc
37              file.cc
38              font_asset.cc
39              font_node.cc
40              gamma_transfer_function.cc
41              interop_load_font_node.cc
42              interop_subtitle_asset.cc
43              j2k.cc
44              key.cc
45              local_time.cc
46              metadata.cc
47              modified_gamma_transfer_function.cc
48              mono_picture_asset.cc
49              mono_picture_asset_writer.cc
50              mono_picture_frame.cc
51              mxf.cc
52              asset_writer.cc
53              object.cc
54              openjpeg_image.cc
55              picture_asset.cc
56              picture_asset_writer.cc
57              reel.cc
58              reel_asset.cc
59              reel_atmos_asset.cc
60              reel_mono_picture_asset.cc
61              reel_mxf.cc
62              reel_picture_asset.cc
63              reel_sound_asset.cc
64              reel_stereo_picture_asset.cc
65              reel_subtitle_asset.cc
66              ref.cc
67              rgb_xyz.cc
68              smpte_load_font_node.cc
69              smpte_subtitle_asset.cc
70              sound_asset.cc
71              sound_asset_writer.cc
72              sound_frame.cc
73              stereo_picture_asset.cc
74              stereo_picture_asset_writer.cc
75              stereo_picture_frame.cc
76              subtitle_node.cc
77              subtitle_asset.cc
78              subtitle_string.cc
79              text_node.cc
80              transfer_function.cc
81              types.cc
82              util.cc
83              version.cc
84              """
85
86     headers = """
87               asset.h
88               atmos_asset.h
89               certificate_chain.h
90               certificate.h
91               chromaticity.h
92               colour_conversion.h
93               colour_matrix.h
94               cpl.h
95               dcp.h
96               dcp_time.h
97               data.h
98               decrypted_kdm.h
99               decrypted_kdm_key.h
100               encrypted_kdm.h
101               exceptions.h
102               font_asset.h
103               gamma_transfer_function.h
104               interop_load_font_node.h
105               interop_subtitle_asset.h
106               j2k.h
107               key.h
108               load_font_node.h
109               local_time.h
110               metadata.h
111               mono_picture_asset.h
112               mono_picture_frame.h
113               modified_gamma_transfer_function.h
114               mxf.h
115               asset_writer.h
116               object.h
117               openjpeg_image.h
118               picture_asset.h
119               picture_asset_writer.h
120               raw_convert.h
121               rgb_xyz.h
122               reel.h
123               reel_asset.h
124               reel_atmos_asset.h
125               reel_mono_picture_asset.h
126               reel_mxf.h
127               reel_picture_asset.h
128               reel_sound_asset.h
129               reel_stereo_picture_asset.h
130               reel_subtitle_asset.h
131               ref.h
132               smpte_load_font_node.h
133               smpte_subtitle_asset.h
134               sound_frame.h
135               sound_asset.h
136               sound_asset_writer.h
137               stereo_picture_asset.h
138               stereo_picture_frame.h
139               subtitle_node.h
140               subtitle_asset.h
141               subtitle_string.h
142               transfer_function.h
143               types.h
144               util.h
145               version.h
146               """
147
148     # Main library
149     if bld.env.STATIC:
150         obj = bld(features='cxx cxxstlib')
151     else:
152         obj = bld(features='cxx cxxshlib')
153     obj.name = 'libdcp%s' % bld.env.API_VERSION
154     obj.target = 'dcp%s' % bld.env.API_VERSION
155     obj.export_includes = ['.']
156     obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1 ASDCPLIB_CTH'
157     obj.use = 'libkumu-libdcp%s libasdcp-libdcp%s' % (bld.env.API_VERSION, bld.env.API_VERSION)
158     obj.source = source
159
160     # Library for gcov
161     if bld.is_defined('HAVE_GCOV'):
162         obj = bld(features='cxx cxxstlib')
163         obj.name = 'libdcp%s_gcov' % bld.env.API_VERSION
164         obj.target = 'dcp%s_gcov' % bld.env.API_VERSION
165         obj.export_includes = ['.']
166         obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1 ASDCPLIB_CTH'
167         obj.use = 'libkumu-libdcp%s libasdcp-libdcp%s' % (bld.env.API_VERSION, bld.env.API_VERSION)
168         obj.source = source
169         obj.cppflags = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
170
171     bld.install_files('${PREFIX}/include/libdcp%s/dcp' % bld.env.API_VERSION, headers)
172     if bld.env.STATIC:
173         bld.install_files('${PREFIX}/lib', 'libdcp%s.a' % bld.env.API_VERSION)