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