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