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