More fixes for errors / crashes / misbehaviour with content changes
[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           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           text_content.cc
42           text_decoder.cc
43           case_insensitive_sorter.cc
44           cinema.cc
45           cinema_kdms.cc
46           cinema_sound_processor.cc
47           colour_conversion.cc
48           config.cc
49           content.cc
50           content_change.cc
51           content_factory.cc
52           cross.cc
53           curl_uploader.cc
54           dcp.cc
55           dcp_content.cc
56           dcp_content_type.cc
57           dcp_decoder.cc
58           dcp_encoder.cc
59           dcp_examiner.cc
60           dcp_subtitle.cc
61           dcp_subtitle_content.cc
62           dcp_subtitle_decoder.cc
63           dcp_video.cc
64           dcpomatic_socket.cc
65           dcpomatic_time.cc
66           decoder.cc
67           decoder_factory.cc
68           decoder_part.cc
69           digester.cc
70           dkdm_wrapper.cc
71           dolby_cp750.cc
72           emailer.cc
73           empty.cc
74           encoder.cc
75           encode_server.cc
76           encode_server_finder.cc
77           encoded_log_entry.cc
78           environment_info.cc
79           event_history.cc
80           examine_content_job.cc
81           exceptions.cc
82           file_group.cc
83           file_log.cc
84           filter_graph.cc
85           ffmpeg.cc
86           ffmpeg_audio_stream.cc
87           ffmpeg_content.cc
88           ffmpeg_decoder.cc
89           ffmpeg_encoder.cc
90           ffmpeg_examiner.cc
91           ffmpeg_stream.cc
92           ffmpeg_subtitle_stream.cc
93           film.cc
94           filter.cc
95           font.cc
96           font_files.cc
97           frame_rate_change.cc
98           hints.cc
99           internet.cc
100           image.cc
101           image_content.cc
102           image_decoder.cc
103           image_examiner.cc
104           image_filename_sorter.cc
105           image_proxy.cc
106           isdcf_metadata.cc
107           j2k_image_proxy.cc
108           job.cc
109           job_manager.cc
110           j2k_encoder.cc
111           json_server.cc
112           log.cc
113           log_entry.cc
114           magick_image_proxy.cc
115           mid_side_decoder.cc
116           overlaps.cc
117           player.cc
118           player_text.cc
119           player_video.cc
120           playlist.cc
121           position_image.cc
122           ratio.cc
123           raw_image_proxy.cc
124           reel_writer.cc
125           render_text.cc
126           resampler.cc
127           rgba.cc
128           scoped_temporary.cc
129           scp_uploader.cc
130           screen.cc
131           screen_kdm.cc
132           send_kdm_email_job.cc
133           send_notification_email_job.cc
134           send_problem_report_job.cc
135           server.cc
136           shuffler.cc
137           string_log_entry.cc
138           string_text_file.cc
139           string_text_file_content.cc
140           string_text_file_decoder.cc
141           text_ring_buffers.cc
142           timer.cc
143           transcode_job.cc
144           types.cc
145           signal_manager.cc
146           update_checker.cc
147           upload_job.cc
148           uploader.cc
149           upmixer_a.cc
150           upmixer_b.cc
151           util.cc
152           verify_dcp_job.cc
153           video_content.cc
154           video_content_scale.cc
155           video_decoder.cc
156           video_filter_graph.cc
157           video_mxf_content.cc
158           video_mxf_decoder.cc
159           video_mxf_examiner.cc
160           video_ring_buffers.cc
161           writer.cc
162           """
163
164 def build(bld):
165     if bld.env.STATIC_DCPOMATIC:
166         obj = bld(features = 'cxx cxxstlib')
167     else:
168         obj = bld(features = 'cxx cxxshlib')
169
170     obj.name = 'libdcpomatic2'
171     obj.export_includes = ['..']
172     obj.uselib = """
173                  AVCODEC AVUTIL AVFORMAT AVFILTER SWSCALE
174                  BOOST_FILESYSTEM BOOST_THREAD BOOST_DATETIME BOOST_SIGNALS2 BOOST_REGEX
175                  SAMPLERATE POSTPROC TIFF MAGICK SSH DCP CXML GLIB LZMA XML++
176                  CURL ZIP FONTCONFIG PANGOMM CAIROMM XMLSEC SUB ICU NETTLE
177                  """
178
179     if bld.env.TARGET_OSX:
180         obj.framework = ['IOKit', 'Foundation']
181
182     obj.source = sources + ' version.cc'
183
184     if bld.env.TARGET_WINDOWS:
185         obj.uselib += ' WINSOCK2 DBGHELP SHLWAPI MSWSOCK BOOST_LOCALE'
186     if bld.env.STATIC_DCPOMATIC:
187         obj.uselib += ' XMLPP'
188
189     obj.target = 'dcpomatic2'
190
191     i18n.po_to_mo(os.path.join('src', 'lib'), 'libdcpomatic2', bld)
192
193 def pot(bld):
194     i18n.pot(os.path.join('src', 'lib'), sources, 'libdcpomatic')
195
196 def pot_merge(bld):
197     i18n.pot_merge(os.path.join('src', 'lib'), 'libdcpomatic')