Pull ActiveSubtitles code out to a class.
[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_subtitles.cc
25           analyse_audio_job.cc
26           atmos_mxf_content.cc
27           audio_analysis.cc
28           audio_buffers.cc
29           audio_content.cc
30           audio_decoder.cc
31           audio_delay.cc
32           audio_filter.cc
33           audio_filter_graph.cc
34           audio_mapping.cc
35           audio_merger.cc
36           audio_point.cc
37           audio_processor.cc
38           audio_ring_buffers.cc
39           audio_stream.cc
40           butler.cc
41           case_insensitive_sorter.cc
42           cinema.cc
43           cinema_kdms.cc
44           cinema_sound_processor.cc
45           colour_conversion.cc
46           config.cc
47           content.cc
48           content_factory.cc
49           cross.cc
50           curl_uploader.cc
51           dcp.cc
52           dcp_content.cc
53           dcp_content_type.cc
54           dcp_decoder.cc
55           dcp_examiner.cc
56           dcp_subtitle.cc
57           dcp_subtitle_content.cc
58           dcp_subtitle_decoder.cc
59           dcp_video.cc
60           dcpomatic_socket.cc
61           dcpomatic_time.cc
62           decoder.cc
63           decoder_factory.cc
64           decoder_part.cc
65           digester.cc
66           dolby_cp750.cc
67           emailer.cc
68           encoder.cc
69           encode_server.cc
70           encode_server_finder.cc
71           encoded_log_entry.cc
72           environment_info.cc
73           examine_content_job.cc
74           exceptions.cc
75           file_group.cc
76           file_log.cc
77           filter_graph.cc
78           ffmpeg.cc
79           ffmpeg_audio_stream.cc
80           ffmpeg_content.cc
81           ffmpeg_decoder.cc
82           ffmpeg_examiner.cc
83           ffmpeg_stream.cc
84           ffmpeg_subtitle_stream.cc
85           film.cc
86           filter.cc
87           font.cc
88           font_files.cc
89           frame_rate_change.cc
90           hints.cc
91           internet.cc
92           image.cc
93           image_content.cc
94           image_decoder.cc
95           image_examiner.cc
96           image_filename_sorter.cc
97           image_proxy.cc
98           isdcf_metadata.cc
99           j2k_image_proxy.cc
100           job.cc
101           job_manager.cc
102           json_server.cc
103           log.cc
104           log_entry.cc
105           magick_image_proxy.cc
106           mid_side_decoder.cc
107           overlaps.cc
108           player.cc
109           player_subtitles.cc
110           player_video.cc
111           playlist.cc
112           position_image.cc
113           ratio.cc
114           raw_image_proxy.cc
115           reel_writer.cc
116           render_subtitles.cc
117           resampler.cc
118           rgba.cc
119           scoped_temporary.cc
120           scp_uploader.cc
121           screen.cc
122           screen_kdm.cc
123           send_kdm_email_job.cc
124           send_problem_report_job.cc
125           server.cc
126           string_log_entry.cc
127           subtitle_content.cc
128           subtitle_decoder.cc
129           text_subtitle.cc
130           text_subtitle_content.cc
131           text_subtitle_decoder.cc
132           timer.cc
133           transcode_job.cc
134           transcoder.cc
135           types.cc
136           signal_manager.cc
137           update_checker.cc
138           upload_job.cc
139           uploader.cc
140           upmixer_a.cc
141           upmixer_b.cc
142           util.cc
143           video_content.cc
144           video_content_scale.cc
145           video_decoder.cc
146           video_filter_graph.cc
147           video_mxf_content.cc
148           video_mxf_decoder.cc
149           video_mxf_examiner.cc
150           video_ring_buffers.cc
151           writer.cc
152           """
153
154 def build(bld):
155     if bld.env.STATIC_DCPOMATIC:
156         obj = bld(features = 'cxx cxxstlib')
157     else:
158         obj = bld(features = 'cxx cxxshlib')
159
160     obj.name = 'libdcpomatic2'
161     obj.export_includes = ['..']
162     obj.uselib = """
163                  AVCODEC AVUTIL AVFORMAT AVFILTER SWSCALE
164                  BOOST_FILESYSTEM BOOST_THREAD BOOST_DATETIME BOOST_SIGNALS2 BOOST_REGEX
165                  SAMPLERATE POSTPROC TIFF MAGICK SSH DCP CXML GLIB LZMA XML++
166                  CURL ZIP FONTCONFIG PANGOMM CAIROMM XMLSEC SUB ICU NETTLE
167                  """
168
169     if bld.env.TARGET_OSX:
170         obj.framework = ['IOKit', 'Foundation']
171
172     obj.source = sources + ' version.cc'
173
174     if bld.env.TARGET_WINDOWS:
175         obj.uselib += ' WINSOCK2 BFD DBGHELP IBERTY SHLWAPI MSWSOCK BOOST_LOCALE'
176     if bld.env.STATIC_DCPOMATIC:
177         obj.uselib += ' XMLPP'
178
179     obj.target = 'dcpomatic2'
180
181     i18n.po_to_mo(os.path.join('src', 'lib'), 'libdcpomatic2', bld)
182
183 def pot(bld):
184     i18n.pot(os.path.join('src', 'lib'), sources, 'libdcpomatic')
185
186 def pot_merge(bld):
187     i18n.pot_merge(os.path.join('src', 'lib'), 'libdcpomatic')