Add video_{range,frame_type}.{cc,h} and remove some types.h includes.
[dcpomatic.git] / src / lib / wscript
1 #
2 #    Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
3 #
4 #    This file is part of DCP-o-matic.
5 #
6 #    DCP-o-matic is free software; you can redistribute it and/or modify
7 #    it under the terms of the GNU General Public License as published by
8 #    the Free Software Foundation; either version 2 of the License, or
9 #    (at your option) any later version.
10 #
11 #    DCP-o-matic is distributed in the hope that it will be useful,
12 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 #    GNU General Public License for more details.
15 #
16 #    You should have received a copy of the GNU General Public License
17 #    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
18 #
19
20 import os
21 import i18n
22
23 sources = """
24           active_text.cc
25           analyse_audio_job.cc
26           analyse_subtitles_job.cc
27           analytics.cc
28           atmos_content.cc
29           atmos_mxf_content.cc
30           atmos_decoder.cc
31           atmos_metadata.cc
32           atmos_mxf_decoder.cc
33           audio_analyser.cc
34           audio_analysis.cc
35           audio_buffers.cc
36           audio_content.cc
37           audio_decoder.cc
38           audio_delay.cc
39           audio_filter.cc
40           audio_filter_graph.cc
41           audio_mapping.cc
42           audio_merger.cc
43           audio_point.cc
44           audio_processor.cc
45           audio_ring_buffers.cc
46           audio_stream.cc
47           butler.cc
48           text_content.cc
49           text_decoder.cc
50           case_insensitive_sorter.cc
51           check_content_job.cc
52           cinema.cc
53           cinema_sound_processor.cc
54           collator.cc
55           colour_conversion.cc
56           config.cc
57           content.cc
58           content_factory.cc
59           combine_dcp_job.cc
60           copy_dcp_details_to_film.cc
61           create_cli.cc
62           crop.cc
63           cross_common.cc
64           crypto.cc
65           curl_uploader.cc
66           datasat_ap2x.cc
67           dcp_content.cc
68           dcp_content_type.cc
69           dcp_decoder.cc
70           dcp_encoder.cc
71           dcp_examiner.cc
72           dcp_digest_file.cc
73           dcp_subtitle.cc
74           dcp_subtitle_content.cc
75           dcp_subtitle_decoder.cc
76           dcp_text_track.cc
77           dcp_transcode_job.cc
78           dcp_video.cc
79           dcpomatic_log.cc
80           dcpomatic_socket.cc
81           dcpomatic_time.cc
82           decoder.cc
83           decoder_factory.cc
84           decoder_part.cc
85           digester.cc
86           dkdm_recipient.cc
87           dkdm_wrapper.cc
88           dolby_cp750.cc
89           emailer.cc
90           empty.cc
91           encoder.cc
92           encode_server.cc
93           encode_server_finder.cc
94           encoded_log_entry.cc
95           environment_info.cc
96           event_history.cc
97           examine_content_job.cc
98           examine_ffmpeg_subtitles_job.cc
99           exceptions.cc
100           export_config.cc
101           file_group.cc
102           file_log.cc
103           filter_graph.cc
104           find_missing.cc
105           ffmpeg.cc
106           ffmpeg_audio_stream.cc
107           ffmpeg_content.cc
108           ffmpeg_decoder.cc
109           ffmpeg_encoder.cc
110           ffmpeg_examiner.cc
111           ffmpeg_file_encoder.cc
112           ffmpeg_image_proxy.cc
113           ffmpeg_stream.cc
114           ffmpeg_subtitle_stream.cc
115           ffmpeg_wrapper.cc
116           film.cc
117           filter.cc
118           font.cc
119           font_config.cc
120           font_id_map.cc
121           frame_interval_checker.cc
122           frame_rate_change.cc
123           guess_crop.cc
124           hints.cc
125           internet.cc
126           image.cc
127           image_content.cc
128           image_decoder.cc
129           image_examiner.cc
130           image_filename_sorter.cc
131           image_jpeg.cc
132           image_png.cc
133           image_proxy.cc
134           image_store.cc
135           j2k_image_proxy.cc
136           job.cc
137           job_manager.cc
138           j2k_encoder.cc
139           json_server.cc
140           kdm_cli.cc
141           kdm_recipient.cc
142           kdm_with_metadata.cc
143           log.cc
144           log_entry.cc
145           make_dcp.cc
146           maths_util.cc
147           memory_util.cc
148           mid_side_decoder.cc
149           named_channel.cc
150           overlaps.cc
151           pixel_quanta.cc
152           player.cc
153           player_video.cc
154           playlist.cc
155           position_image.cc
156           ratio.cc
157           raw_image_proxy.cc
158           reel_writer.cc
159           referenced_reel_asset.cc
160           release_notes.cc
161           render_text.cc
162           resampler.cc
163           resolution.cc
164           rgba.cc
165           rng.cc
166           scoped_temporary.cc
167           scp_uploader.cc
168           screen.cc
169           send_kdm_email_job.cc
170           send_notification_email_job.cc
171           send_problem_report_job.cc
172           server.cc
173           shuffler.cc
174           state.cc
175           spl.cc
176           spl_entry.cc
177           string_log_entry.cc
178           string_text_file.cc
179           string_text_file_content.cc
180           string_text_file_decoder.cc
181           subtitle_analysis.cc
182           subtitle_encoder.cc
183           text_ring_buffers.cc
184           timer.cc
185           transcode_job.cc
186           trusted_device.cc
187           types.cc
188           rough_duration.cc
189           signal_manager.cc
190           stdout_log.cc
191           update_checker.cc
192           upload_job.cc
193           uploader.cc
194           upmixer_a.cc
195           upmixer_b.cc
196           usl.cc
197           util.cc
198           verify_dcp_job.cc
199           video_content.cc
200           video_decoder.cc
201           video_filter_graph.cc
202           video_filter_graph_set.cc
203           video_frame_type.cc
204           video_mxf_content.cc
205           video_mxf_decoder.cc
206           video_mxf_examiner.cc
207           video_range.cc
208           video_ring_buffers.cc
209           writer.cc
210           zipper.cc
211           """
212
213 def build(bld):
214     if bld.env.STATIC_DCPOMATIC:
215         obj = bld(features = 'cxx cxxstlib')
216     else:
217         obj = bld(features = 'cxx cxxshlib')
218
219     obj.name = 'libdcpomatic2'
220     obj.export_includes = ['..']
221     obj.uselib = """
222                  AVCODEC AVUTIL AVFORMAT AVFILTER SWSCALE
223                  BOOST_FILESYSTEM BOOST_THREAD BOOST_DATETIME BOOST_SIGNALS2 BOOST_REGEX
224                  SAMPLERATE POSTPROC TIFF SSH DCP CXML GLIB LZMA XML++
225                  CURL ZIP BZ2 FONTCONFIG PANGOMM CAIROMM XMLSEC SUB ICU NETTLE PNG JPEG LEQM_NRT
226                  """
227
228     if bld.env.TARGET_OSX:
229         obj.framework = ['IOKit', 'Foundation', 'DiskArbitration', 'ApplicationServices']
230
231     obj.source = sources + ' version.cc'
232
233     if bld.env.ENABLE_DISK:
234         obj.source += ' copy_to_drive_job.cc ext.cc nanomsg.cc'
235         obj.uselib += ' LWEXT4 NANOMSG'
236         if bld.env.TARGET_LINUX:
237             obj.uselib += ' POLKIT'
238
239     if bld.env.TARGET_WINDOWS_64 or bld.env.TARGET_WINDOWS_32:
240         obj.uselib += ' WINSOCK2 DBGHELP SHLWAPI MSWSOCK BOOST_LOCALE SETUPAPI OLE32 UUID'
241         obj.source += ' cross_windows.cc'
242     if bld.env.TARGET_OSX:
243         obj.source += ' cross_osx.cc cross_unix.cc'
244     if bld.env.TARGET_LINUX:
245         obj.source += ' cross_linux.cc cross_unix.cc'
246     if bld.env.STATIC_DCPOMATIC:
247         obj.uselib += ' XMLPP'
248
249     obj.target = 'dcpomatic2'
250
251     i18n.po_to_mo(os.path.join('src', 'lib'), 'libdcpomatic2', bld)
252
253 def pot(bld):
254     i18n.pot(os.path.join('src', 'lib'), sources + " util.h", 'libdcpomatic')
255
256 def pot_merge(bld):
257     i18n.pot_merge(os.path.join('src', 'lib'), 'libdcpomatic')