Possibly inaccurate port of master; build system cleanups.
[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_filter.cc
29           audio_mapping.cc
30           audio_processor.cc
31           cinema.cc
32           cinema_sound_processor.cc
33           colour_conversion.cc
34           config.cc
35           content.cc
36           content_factory.cc
37           content_subtitle.cc
38           cross.cc
39           dcp_content.cc
40           dcp_content_type.cc
41           dcp_decoder.cc
42           dcp_examiner.cc
43           dcp_subtitle.cc
44           dcp_subtitle_content.cc
45           dcp_subtitle_decoder.cc
46           dcp_video.cc
47           dcpomatic_socket.cc
48           dcpomatic_time.cc
49           dolby_cp750.cc
50           encoder.cc
51           encoded_data.cc
52           environment_info.cc
53           examine_content_job.cc
54           exceptions.cc
55           file_group.cc
56           filter_graph.cc
57           ffmpeg.cc
58           ffmpeg_audio_stream.cc
59           ffmpeg_content.cc
60           ffmpeg_decoder.cc
61           ffmpeg_examiner.cc
62           ffmpeg_stream.cc
63           ffmpeg_subtitle_stream.cc
64           film.cc
65           filter.cc
66           font.cc
67           frame_rate_change.cc
68           internet.cc
69           image.cc
70           image_content.cc
71           image_decoder.cc
72           image_examiner.cc
73           image_proxy.cc
74           isdcf_metadata.cc
75           j2k_image_proxy.cc
76           job.cc
77           job_manager.cc
78           kdm.cc
79           json_server.cc
80           log.cc
81           magick_image_proxy.cc
82           md5_digester.cc
83           mid_side_decoder.cc
84           player.cc
85           player_video.cc
86           playlist.cc
87           position_image.cc
88           quickmail.cc
89           ratio.cc
90           raw_image_proxy.cc
91           render_subtitles.cc
92           resampler.cc
93           safe_stringstream.cc
94           scp_dcp_job.cc
95           scoped_temporary.cc
96           send_kdm_email_job.cc
97           send_problem_report_job.cc
98           server.cc
99           server_finder.cc
100           single_stream_audio_content.cc
101           sndfile_content.cc
102           sndfile_decoder.cc
103           subrip.cc
104           subrip_content.cc
105           subrip_decoder.cc
106           subtitle_content.cc
107           subtitle_decoder.cc
108           timer.cc
109           transcode_job.cc
110           transcoder.cc
111           types.cc
112           ui_signaller.cc
113           update.cc
114           upmixer_a.cc
115           util.cc
116           video_content.cc
117           video_content_scale.cc
118           video_decoder.cc
119           writer.cc
120           """
121
122 def build(bld):
123     if bld.env.STATIC_DCPOMATIC:
124         obj = bld(features = 'cxx cxxstlib')
125     else:
126         obj = bld(features = 'cxx cxxshlib')
127
128     obj.name = 'libdcpomatic2'
129     obj.export_includes = ['..']
130     obj.uselib = """
131                  AVCODEC AVUTIL AVFORMAT AVFILTER SWSCALE SWRESAMPLE 
132                  BOOST_FILESYSTEM BOOST_THREAD BOOST_DATETIME BOOST_SIGNALS2
133                  SNDFILE OPENJPEG POSTPROC TIFF MAGICK SSH DCP CXML GLIB LZMA XML++
134                  CURL ZIP PANGOMM CAIROMM XMLSEC SUB
135                  """
136
137     if bld.env.TARGET_OSX:
138         obj.framework = ['IOKit', 'Foundation']
139
140     obj.source = sources + ' version.cc'
141
142     if bld.env.TARGET_WINDOWS:
143         obj.uselib += ' WINSOCK2 BFD DBGHELP IBERTY SHLWAPI MSWSOCK BOOST_LOCALE'
144     if bld.env.STATIC_DCPOMATIC:
145         obj.uselib += ' XMLPP'
146
147     obj.target = 'dcpomatic2'
148
149     i18n.po_to_mo(os.path.join('src', 'lib'), 'libdcpomatic2', bld)
150
151 def pot(bld):
152     i18n.pot(os.path.join('src', 'lib'), sources, 'libdcpomatic')
153
154 def pot_merge(bld):
155     i18n.pot_merge(os.path.join('src', 'lib'), 'libdcpomatic')