Missing header install.
[libdcp.git] / src / wscript
1 #
2 #    Copyright (C) 2012-2019 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_factory.cc
39              asset_writer.cc
40              atmos_asset.cc
41              atmos_asset_writer.cc
42              certificate_chain.cc
43              certificate.cc
44              chromaticity.cc
45              colour_conversion.cc
46              cpl.cc
47              data.cc
48              dcp.cc
49              dcp_time.cc
50              decrypted_kdm.cc
51              decrypted_kdm_key.cc
52              encrypted_kdm.cc
53              exceptions.cc
54              file.cc
55              font_asset.cc
56              gamma_transfer_function.cc
57              identity_transfer_function.cc
58              interop_load_font_node.cc
59              interop_subtitle_asset.cc
60              j2k.cc
61              key.cc
62              local_time.cc
63              locale_convert.cc
64              metadata.cc
65              modified_gamma_transfer_function.cc
66              mono_picture_asset.cc
67              mono_picture_asset_writer.cc
68              mono_picture_frame.cc
69              mxf.cc
70              name_format.cc
71              object.cc
72              openjpeg_image.cc
73              picture_asset.cc
74              picture_asset_writer.cc
75              pkl.cc
76              raw_convert.cc
77              reel.cc
78              reel_asset.cc
79              reel_atmos_asset.cc
80              reel_closed_caption_asset.cc
81              reel_mono_picture_asset.cc
82              reel_mxf.cc
83              reel_picture_asset.cc
84              reel_markers_asset.cc
85              reel_sound_asset.cc
86              reel_stereo_picture_asset.cc
87              reel_subtitle_asset.cc
88              ref.cc
89              rgb_xyz.cc
90              s_gamut3_transfer_function.cc
91              smpte_load_font_node.cc
92              smpte_subtitle_asset.cc
93              sound_asset.cc
94              sound_asset_writer.cc
95              sound_frame.cc
96              stereo_picture_asset.cc
97              stereo_picture_asset_writer.cc
98              stereo_picture_frame.cc
99              subtitle.cc
100              subtitle_asset.cc
101              subtitle_asset_internal.cc
102              subtitle_image.cc
103              subtitle_string.cc
104              transfer_function.cc
105              types.cc
106              util.cc
107              verify.cc
108              version.cc
109              """
110
111     headers = """
112               asset.h
113               asset_reader.h
114               asset_writer.h
115               atmos_asset.h
116               atmos_asset_reader.h
117               atmos_asset_writer.h
118               atmos_frame.h
119               certificate_chain.h
120               certificate.h
121               chromaticity.h
122               colour_conversion.h
123               cpl.h
124               crypto_context.h
125               dcp.h
126               dcp_assert.h
127               dcp_time.h
128               data.h
129               decrypted_kdm.h
130               decrypted_kdm_key.h
131               encrypted_kdm.h
132               exceptions.h
133               font_asset.h
134               frame.h
135               gamma_transfer_function.h
136               identity_transfer_function.h
137               interop_load_font_node.h
138               interop_subtitle_asset.h
139               j2k.h
140               key.h
141               load_font_node.h
142               local_time.h
143               locale_convert.h
144               metadata.h
145               mono_picture_asset.h
146               mono_picture_asset_reader.h
147               mono_picture_frame.h
148               modified_gamma_transfer_function.h
149               mxf.h
150               name_format.h
151               object.h
152               openjpeg_image.h
153               picture_asset.h
154               picture_asset_writer.h
155               pkl.h
156               raw_convert.h
157               rgb_xyz.h
158               reel.h
159               reel_asset.h
160               reel_atmos_asset.h
161               reel_closed_caption_asset.h
162               reel_markers_asset.h
163               reel_mono_picture_asset.h
164               reel_mxf.h
165               reel_picture_asset.h
166               reel_sound_asset.h
167               reel_stereo_picture_asset.h
168               reel_subtitle_asset.h
169               ref.h
170               s_gamut3_transfer_function.h
171               smpte_load_font_node.h
172               smpte_subtitle_asset.h
173               sound_frame.h
174               sound_asset.h
175               sound_asset_reader.h
176               sound_asset_writer.h
177               stereo_picture_asset.h
178               stereo_picture_asset_reader.h
179               stereo_picture_asset_writer.h
180               stereo_picture_frame.h
181               subtitle.h
182               subtitle_asset.h
183               subtitle_image.h
184               subtitle_string.h
185               transfer_function.h
186               types.h
187               util.h
188               verify.h
189               version.h
190               """
191
192     # Main library
193     if bld.env.STATIC:
194         obj = bld(features='cxx cxxstlib')
195     else:
196         obj = bld(features='cxx cxxshlib')
197     obj.name = 'libdcp%s' % bld.env.API_VERSION
198     obj.target = 'dcp%s' % bld.env.API_VERSION
199     obj.export_includes = ['.']
200     obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1 ASDCPLIB_CTH'
201     obj.source = source
202
203     # Library for gcov
204     if bld.is_defined('HAVE_GCOV'):
205         if bld.env.STATIC:
206             obj = bld(features='cxx cxxstlib')
207         else:
208             obj = bld(features='cxx cxxshlib')
209         obj.name = 'libdcp%s_gcov' % bld.env.API_VERSION
210         obj.target = 'dcp%s_gcov' % bld.env.API_VERSION
211         obj.export_includes = ['.']
212         obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1 ASDCPLIB_CTH'
213         obj.use = 'libkumu-libdcp%s libasdcp-libdcp%s' % (bld.env.API_VERSION, bld.env.API_VERSION)
214         obj.source = source
215         obj.cppflags = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
216
217     bld.install_files('${PREFIX}/include/libdcp%s/dcp' % bld.env.API_VERSION, headers)
218     if bld.env.STATIC:
219         bld.install_files('${PREFIX}/lib', 'libdcp%s.a' % bld.env.API_VERSION)