b78586843aef7d4f7f1f35a101e112631c1acc70
[dcpomatic.git] / src / lib / wscript
1 #
2 #    Copyright (C) 2012-2015 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           analytics.cc
27           atmos_mxf_content.cc
28           atomicity_checker.cc
29           audio_analysis.cc
30           audio_buffers.cc
31           audio_content.cc
32           audio_decoder.cc
33           audio_delay.cc
34           audio_filter.cc
35           audio_filter_graph.cc
36           audio_mapping.cc
37           audio_merger.cc
38           audio_point.cc
39           audio_processor.cc
40           audio_ring_buffers.cc
41           audio_stream.cc
42           butler.cc
43           text_content.cc
44           text_decoder.cc
45           case_insensitive_sorter.cc
46           checker.cc
47           check_content_change_job.cc
48           cinema.cc
49           cinema_kdms.cc
50           cinema_sound_processor.cc
51           colour_conversion.cc
52           config.cc
53           content.cc
54           content_factory.cc
55           create_cli.cc
56           cross.cc
57           crypto.cc
58           curl_uploader.cc
59           datasat_ap2x.cc
60           dcp.cc
61           dcp_content.cc
62           dcp_content_type.cc
63           dcp_decoder.cc
64           dcp_encoder.cc
65           dcp_examiner.cc
66           dcp_subtitle.cc
67           dcp_subtitle_content.cc
68           dcp_subtitle_decoder.cc
69           dcp_text_track.cc
70           dcp_video.cc
71           dcpomatic_log.cc
72           dcpomatic_socket.cc
73           dcpomatic_time.cc
74           decoder.cc
75           decoder_factory.cc
76           decoder_part.cc
77           decrypted_ecinema_kdm.cc
78           digester.cc
79           dkdm_wrapper.cc
80           dolby_cp750.cc
81           edid.cc
82           emailer.cc
83           empty.cc
84           encoder.cc
85           encode_server.cc
86           encode_server_finder.cc
87           encoded_log_entry.cc
88           encrypted_ecinema_kdm.cc
89           environment_info.cc
90           event_history.cc
91           examine_content_job.cc
92           examine_ffmpeg_subtitles_job.cc
93           exceptions.cc
94           file_group.cc
95           file_log.cc
96           filter_graph.cc
97           ffmpeg.cc
98           ffmpeg_audio_stream.cc
99           ffmpeg_content.cc
100           ffmpeg_decoder.cc
101           ffmpeg_encoder.cc
102           ffmpeg_file_encoder.cc
103           ffmpeg_examiner.cc
104           ffmpeg_stream.cc
105           ffmpeg_subtitle_stream.cc
106           film.cc
107           filter.cc
108           ffmpeg_image_proxy.cc
109           font.cc
110           frame_rate_change.cc
111           hints.cc
112           internet.cc
113           image.cc
114           image_content.cc
115           image_decoder.cc
116           image_examiner.cc
117           image_filename_sorter.cc
118           image_proxy.cc
119           isdcf_metadata.cc
120           j2k_image_proxy.cc
121           job.cc
122           job_manager.cc
123           j2k_encoder.cc
124           json_server.cc
125           lock_file_checker.cc
126           log.cc
127           log_entry.cc
128           mid_side_decoder.cc
129           monitor_checker.cc
130           overlaps.cc
131           player.cc
132           player_text.cc
133           player_video.cc
134           playlist.cc
135           position_image.cc
136           ratio.cc
137           raw_image_proxy.cc
138           reel_writer.cc
139           render_text.cc
140           resampler.cc
141           rgba.cc
142           scoped_temporary.cc
143           scp_uploader.cc
144           screen.cc
145           screen_kdm.cc
146           send_kdm_email_job.cc
147           send_notification_email_job.cc
148           send_problem_report_job.cc
149           server.cc
150           shuffler.cc
151           state.cc
152           spl.cc
153           spl_entry.cc
154           string_log_entry.cc
155           string_text_file.cc
156           string_text_file_content.cc
157           string_text_file_decoder.cc
158           subtitle_encoder.cc
159           text_ring_buffers.cc
160           timer.cc
161           transcode_job.cc
162           types.cc
163           signal_manager.cc
164           update_checker.cc
165           upload_job.cc
166           uploader.cc
167           upmixer_a.cc
168           upmixer_b.cc
169           usl.cc
170           util.cc
171           verify_dcp_job.cc
172           video_content.cc
173           video_content_scale.cc
174           video_decoder.cc
175           video_filter_graph.cc
176           video_mxf_content.cc
177           video_mxf_decoder.cc
178           video_mxf_examiner.cc
179           video_ring_buffers.cc
180           writer.cc
181           """
182
183 def build(bld):
184     if bld.env.STATIC_DCPOMATIC:
185         obj = bld(features = 'cxx cxxstlib')
186     else:
187         obj = bld(features = 'cxx cxxshlib')
188
189     obj.name = 'libdcpomatic2'
190     obj.export_includes = ['..']
191     obj.uselib = """
192                  AVCODEC AVUTIL AVFORMAT AVFILTER SWSCALE
193                  BOOST_FILESYSTEM BOOST_THREAD BOOST_DATETIME BOOST_SIGNALS2 BOOST_REGEX
194                  SAMPLERATE POSTPROC TIFF SSH DCP CXML GLIB LZMA XML++
195                  CURL ZIP FONTCONFIG PANGOMM CAIROMM XMLSEC SUB ICU NETTLE PNG
196                  """
197
198     if bld.env.TARGET_OSX:
199         obj.framework = ['IOKit', 'Foundation']
200
201     obj.source = sources + ' version.cc'
202
203     if bld.env.TARGET_WINDOWS:
204         obj.uselib += ' WINSOCK2 DBGHELP SHLWAPI MSWSOCK BOOST_LOCALE'
205     if bld.env.STATIC_DCPOMATIC:
206         obj.uselib += ' XMLPP'
207
208     obj.target = 'dcpomatic2'
209
210     i18n.po_to_mo(os.path.join('src', 'lib'), 'libdcpomatic2', bld)
211
212 def pot(bld):
213     i18n.pot(os.path.join('src', 'lib'), sources + " util.h", 'libdcpomatic')
214
215 def pot_merge(bld):
216     i18n.pot_merge(os.path.join('src', 'lib'), 'libdcpomatic')