Add dcpomatic2_map tool (#2445).
[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           change_signaller.cc
55           collator.cc
56           colour_conversion.cc
57           config.cc
58           content.cc
59           content_factory.cc
60           combine_dcp_job.cc
61           copy_dcp_details_to_film.cc
62           create_cli.cc
63           crop.cc
64           cross_common.cc
65           crypto.cc
66           curl_uploader.cc
67           datasat_ap2x.cc
68           dcp_content.cc
69           dcp_content_type.cc
70           dcp_decoder.cc
71           dcp_encoder.cc
72           dcp_examiner.cc
73           dcp_digest_file.cc
74           dcp_subtitle.cc
75           dcp_subtitle_content.cc
76           dcp_subtitle_decoder.cc
77           dcp_text_track.cc
78           dcp_transcode_job.cc
79           dcp_video.cc
80           dcpomatic_log.cc
81           dcpomatic_socket.cc
82           dcpomatic_time.cc
83           decoder.cc
84           decoder_factory.cc
85           decoder_part.cc
86           digester.cc
87           dkdm_recipient.cc
88           dkdm_wrapper.cc
89           dolby_cp750.cc
90           emailer.cc
91           empty.cc
92           encoder.cc
93           encode_server.cc
94           encode_server_finder.cc
95           encoded_log_entry.cc
96           environment_info.cc
97           event_history.cc
98           examine_content_job.cc
99           examine_ffmpeg_subtitles_job.cc
100           exceptions.cc
101           export_config.cc
102           file_group.cc
103           file_log.cc
104           filter_graph.cc
105           find_missing.cc
106           ffmpeg.cc
107           ffmpeg_audio_stream.cc
108           ffmpeg_content.cc
109           ffmpeg_decoder.cc
110           ffmpeg_encoder.cc
111           ffmpeg_examiner.cc
112           ffmpeg_file_encoder.cc
113           ffmpeg_image_proxy.cc
114           ffmpeg_stream.cc
115           ffmpeg_subtitle_stream.cc
116           ffmpeg_wrapper.cc
117           film.cc
118           filter.cc
119           font.cc
120           font_config.cc
121           font_id_map.cc
122           frame_interval_checker.cc
123           frame_rate_change.cc
124           guess_crop.cc
125           hints.cc
126           internet.cc
127           image.cc
128           image_content.cc
129           image_decoder.cc
130           image_examiner.cc
131           image_filename_sorter.cc
132           image_jpeg.cc
133           image_png.cc
134           image_proxy.cc
135           image_store.cc
136           j2k_image_proxy.cc
137           job.cc
138           job_manager.cc
139           j2k_encoder.cc
140           json_server.cc
141           kdm_cli.cc
142           kdm_recipient.cc
143           kdm_with_metadata.cc
144           kdm_util.cc
145           log.cc
146           log_entry.cc
147           make_dcp.cc
148           map_cli.cc
149           maths_util.cc
150           memory_util.cc
151           mid_side_decoder.cc
152           named_channel.cc
153           overlaps.cc
154           pixel_quanta.cc
155           player.cc
156           player_video.cc
157           playlist.cc
158           position_image.cc
159           ratio.cc
160           raw_image_proxy.cc
161           reel_writer.cc
162           referenced_reel_asset.cc
163           release_notes.cc
164           render_text.cc
165           resampler.cc
166           resolution.cc
167           rgba.cc
168           rng.cc
169           scoped_temporary.cc
170           scp_uploader.cc
171           screen.cc
172           send_kdm_email_job.cc
173           send_notification_email_job.cc
174           send_problem_report_job.cc
175           server.cc
176           shuffler.cc
177           state.cc
178           spl.cc
179           spl_entry.cc
180           string_log_entry.cc
181           string_text_file.cc
182           string_text_file_content.cc
183           string_text_file_decoder.cc
184           subtitle_analysis.cc
185           subtitle_encoder.cc
186           text_ring_buffers.cc
187           text_type.cc
188           timer.cc
189           transcode_job.cc
190           trusted_device.cc
191           types.cc
192           rough_duration.cc
193           signal_manager.cc
194           stdout_log.cc
195           update_checker.cc
196           upload_job.cc
197           uploader.cc
198           upmixer_a.cc
199           upmixer_b.cc
200           usl.cc
201           util.cc
202           verify_dcp_job.cc
203           video_content.cc
204           video_decoder.cc
205           video_filter_graph.cc
206           video_filter_graph_set.cc
207           video_frame_type.cc
208           video_mxf_content.cc
209           video_mxf_decoder.cc
210           video_mxf_examiner.cc
211           video_range.cc
212           video_ring_buffers.cc
213           writer.cc
214           zipper.cc
215           """
216
217 def build(bld):
218     if bld.env.STATIC_DCPOMATIC:
219         obj = bld(features = 'cxx cxxstlib')
220     else:
221         obj = bld(features = 'cxx cxxshlib')
222
223     obj.name = 'libdcpomatic2'
224     obj.export_includes = ['..']
225     obj.uselib = """
226                  AVCODEC AVUTIL AVFORMAT AVFILTER SWSCALE
227                  BOOST_FILESYSTEM BOOST_THREAD BOOST_DATETIME BOOST_SIGNALS2 BOOST_REGEX
228                  SAMPLERATE POSTPROC TIFF SSH DCP CXML GLIB LZMA XML++
229                  CURL ZIP BZ2 FONTCONFIG PANGOMM CAIROMM XMLSEC SUB ICU NETTLE PNG JPEG LEQM_NRT
230                  """
231
232     if bld.env.TARGET_OSX:
233         obj.framework = ['IOKit', 'Foundation', 'DiskArbitration', 'ApplicationServices']
234
235     obj.source = sources + ' version.cc'
236
237     if bld.env.ENABLE_DISK:
238         obj.source += ' copy_to_drive_job.cc disk_writer_messages.cc ext.cc nanomsg.cc'
239         obj.uselib += ' LWEXT4 NANOMSG'
240         if bld.env.TARGET_LINUX:
241             obj.uselib += ' POLKIT'
242
243     if bld.env.TARGET_WINDOWS_64 or bld.env.TARGET_WINDOWS_32:
244         obj.uselib += ' WINSOCK2 DBGHELP SHLWAPI MSWSOCK BOOST_LOCALE SETUPAPI OLE32 UUID'
245         obj.source += ' cross_windows.cc'
246     if bld.env.TARGET_OSX:
247         obj.source += ' cross_osx.cc cross_unix.cc'
248     if bld.env.TARGET_LINUX:
249         obj.source += ' cross_linux.cc cross_unix.cc'
250     if bld.env.STATIC_DCPOMATIC:
251         obj.uselib += ' XMLPP'
252
253     obj.target = 'dcpomatic2'
254
255     i18n.po_to_mo(os.path.join('src', 'lib'), 'libdcpomatic2', bld)
256
257 def pot(bld):
258     i18n.pot(os.path.join('src', 'lib'), sources + " util.h", 'libdcpomatic')
259
260 def pot_merge(bld):
261     i18n.pot_merge(os.path.join('src', 'lib'), 'libdcpomatic')