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