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