Move quite a lot of stuff out of Writer into a new class
[dcpomatic.git] / src / lib / wscript
1 #
2 #    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
3 #
4 #    This program is free software; you can redistribute it and/or modify
5 #    it under the terms of the GNU General Public License as published by
6 #    the Free Software Foundation; either version 2 of the License, or
7 #    (at your option) any later version.
8 #
9 #    This program is distributed in the hope that it will be useful,
10 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 #    GNU General Public License for more details.
13 #
14 #    You should have received a copy of the GNU General Public License
15 #    along with this program; if not, write to the Free Software
16 #    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 #
18
19 import os
20 import i18n
21
22 sources = """
23           analyse_audio_job.cc
24           audio_analysis.cc
25           audio_buffers.cc
26           audio_content.cc
27           audio_decoder.cc
28           audio_decoder_stream.cc
29           audio_delay.cc
30           audio_filter.cc
31           audio_mapping.cc
32           audio_point.cc
33           audio_processor.cc
34           audio_stream.cc
35           cinema.cc
36           cinema_kdms.cc
37           cinema_sound_processor.cc
38           colour_conversion.cc
39           config.cc
40           content.cc
41           content_factory.cc
42           cross.cc
43           curl_uploader.cc
44           data.cc
45           dcp_content.cc
46           dcp_content_type.cc
47           dcp_decoder.cc
48           dcp_examiner.cc
49           dcp_subtitle.cc
50           dcp_subtitle_content.cc
51           dcp_subtitle_decoder.cc
52           dcp_video.cc
53           dcpomatic_socket.cc
54           dcpomatic_time.cc
55           dolby_cp750.cc
56           emailer.cc
57           encoder.cc
58           encoded_log_entry.cc
59           environment_info.cc
60           examine_content_job.cc
61           exceptions.cc
62           file_group.cc
63           file_log.cc
64           filter_graph.cc
65           ffmpeg.cc
66           ffmpeg_audio_stream.cc
67           ffmpeg_content.cc
68           ffmpeg_decoder.cc
69           ffmpeg_examiner.cc
70           ffmpeg_stream.cc
71           ffmpeg_subtitle_stream.cc
72           film.cc
73           filter.cc
74           font.cc
75           frame_rate_change.cc
76           internet.cc
77           image.cc
78           image_content.cc
79           image_decoder.cc
80           image_examiner.cc
81           image_proxy.cc
82           isdcf_metadata.cc
83           j2k_image_proxy.cc
84           job.cc
85           job_manager.cc
86           json_server.cc
87           log.cc
88           log_entry.cc
89           magick_image_proxy.cc
90           md5_digester.cc
91           mid_side_decoder.cc
92           player.cc
93           player_subtitles.cc
94           player_video.cc
95           playlist.cc
96           position_image.cc
97           ratio.cc
98           raw_image_proxy.cc
99           reel_writer.cc
100           render_subtitles.cc
101           resampler.cc
102           safe_stringstream.cc
103           scoped_temporary.cc
104           scp_uploader.cc
105           screen.cc
106           screen_kdm.cc
107           send_kdm_email_job.cc
108           send_problem_report_job.cc
109           server.cc
110           server_finder.cc
111           single_stream_audio_content.cc
112           sndfile_base.cc
113           sndfile_content.cc
114           sndfile_decoder.cc
115           sndfile_examiner.cc
116           string_log_entry.cc
117           subrip.cc
118           subrip_content.cc
119           subrip_decoder.cc
120           subtitle_content.cc
121           subtitle_decoder.cc
122           timer.cc
123           transcode_job.cc
124           transcoder.cc
125           types.cc
126           signal_manager.cc
127           update_checker.cc
128           upload_job.cc
129           uploader.cc
130           upmixer_a.cc
131           upmixer_b.cc
132           util.cc
133           video_content.cc
134           video_content_scale.cc
135           video_decoder.cc
136           writer.cc
137           """
138
139 def build(bld):
140     if bld.env.STATIC_DCPOMATIC:
141         obj = bld(features = 'cxx cxxstlib')
142     else:
143         obj = bld(features = 'cxx cxxshlib')
144
145     obj.name = 'libdcpomatic2'
146     obj.export_includes = ['..']
147     obj.uselib = """
148                  AVCODEC AVUTIL AVFORMAT AVFILTER SWSCALE
149                  BOOST_FILESYSTEM BOOST_THREAD BOOST_DATETIME BOOST_SIGNALS2 BOOST_REGEX
150                  SNDFILE SAMPLERATE OPENJPEG POSTPROC TIFF MAGICK SSH DCP CXML GLIB LZMA XML++
151                  CURL ZIP FONTCONFIG PANGOMM CAIROMM XMLSEC SUB ICU
152                  """
153
154     if bld.env.TARGET_OSX:
155         obj.framework = ['IOKit', 'Foundation']
156
157     obj.source = sources + ' version.cc'
158
159     if bld.env.TARGET_WINDOWS:
160         obj.uselib += ' WINSOCK2 BFD DBGHELP IBERTY SHLWAPI MSWSOCK BOOST_LOCALE'
161     if bld.env.STATIC_DCPOMATIC:
162         obj.uselib += ' XMLPP'
163
164     obj.target = 'dcpomatic2'
165
166     i18n.po_to_mo(os.path.join('src', 'lib'), 'libdcpomatic2', bld)
167
168 def pot(bld):
169     i18n.pot(os.path.join('src', 'lib'), sources, 'libdcpomatic')
170
171 def pot_merge(bld):
172     i18n.pot_merge(os.path.join('src', 'lib'), 'libdcpomatic')