changes from colin for route_params, nick for location_ui and route_ui, and me for...
[ardour.git] / gtk2_ardour / SConscript
1 # -*- python -*-
2
3 import os
4 import os.path
5 import glob
6
7 Import('env install_prefix final_prefix config_prefix libraries i18n version')
8
9 gtkardour = env.Copy()
10
11 #
12 # this defines the version number of the GTK interface to ardour
13 #
14
15 domain = 'gtk_ardour'
16
17 gtkardour.Append(DOMAIN=domain, MAJOR=1,MINOR=0,MICRO=2)
18 gtkardour.Append(CXXFLAGS="-DPACKAGE=\\\"" + domain + "\\\"")
19 gtkardour.Append(CCFLAGS="-DLIBSIGC_DISABLE_DEPRECATED")
20 gtkardour.Append(PACKAGE=domain)
21 gtkardour.Append(POTFILE=domain + '.pot')
22
23 gtkardour.Merge ([
24     libraries['ardour'],
25     libraries['gtkmm2ext'],
26     libraries['midi++2'],
27     libraries['pbd3'],
28     libraries['gtkmm2'],
29     libraries['libgnomecanvasmm'],
30     libraries['sysmidi'],
31     libraries['sndfile'],
32     libraries['lrdf'],
33     libraries['glibmm2'],
34     libraries['pangomm'],
35     libraries['atkmm'],
36     libraries['gdkmm2'],
37     libraries['sigc2'],
38     libraries['gtk2'],
39     libraries['libgnomecanvas2'],
40     libraries['xml'],
41     libraries['soundtouch'],
42     libraries['raptor'],
43     libraries['samplerate'],
44     libraries['jack']
45 ])
46
47 if gtkardour['VST']:
48     gtkardour.Merge ([ libraries['fst']])
49
50 gtkardour_files=Split("""
51 add_route_dialog.cc
52 ardour_dialog.cc
53 ardour_message.cc
54 audio_clock.cc
55 automation_gain_line.cc
56 axis_view.cc
57 default_keys.cc
58 editing.cc
59 gain_automation_time_axis.cc
60 grouped_buttons.cc
61 gtk-custom-hruler.c
62 gtk-custom-ruler.c
63 keyboard.cc
64 keyboard_target.cc
65 meter_bridge_strip.cc
66 opts.cc
67 pan_automation_time_axis.cc
68 prompter.cc
69 redirect_automation_line.cc
70 redirect_automation_time_axis.cc
71 route_redirect_selection.cc
72 tempo_dialog.cc
73 time_selection.cc
74 version.cc
75 ardour_ui_dependents.cc
76 ardour_ui_mixer.cc
77 automation_pan_line.cc
78 curvetest.cc
79 editor_scrub.cc
80 ghostregion.cc
81 imageframe_time_axis.cc
82 imageframe_time_axis_view.cc
83 imageframe_view.cc
84 marker.cc
85 marker_time_axis.cc
86 marker_time_axis_view.cc
87 marker_view.cc
88 public_editor.cc
89 region_gain_line.cc
90 region_selection.cc
91 selection.cc
92 ardour_ui_ed.cc
93 canvas-ruler.c
94 canvas-simpleline.c
95 canvas-simplerect.c
96 canvas-waveview.c
97 editor_audiotrack.cc
98 editor_canvas_events.cc
99 editor_cursors.cc
100 editor_export_audio.cc
101 editor_keys.cc
102 editor_nudge.cc
103 editor_timefx.cc
104 imageframe_time_axis_group.cc
105 send_ui.cc
106 time_axis_view.cc
107 editor_markers.cc
108 editor_tempodisplay.cc
109 main.cc
110 panner2d.cc
111 region_editor.cc
112 streamview.cc
113 utils.cc
114 automation_time_axis.cc
115 connection_editor.cc
116 crossfade_edit.cc
117 crossfade_view.cc
118 editor_hscroller.cc
119 editor_mixer.cc
120 imageframe_socket_handler.cc
121 location_ui.cc
122 route_ui.cc
123 time_axis_view_item.cc
124 visual_time_axis.cc
125 ardour_ui.cc
126 ardour_ui2.cc
127 ardour_ui_dialogs.cc
128 audio_time_axis.cc
129 automation_line.cc
130 canvas-imageframe.cc
131 about.cc
132 editor.cc
133 editor_edit_groups.cc
134 editor_imageframe.cc
135 editor_keyboard.cc
136 editor_mouse.cc
137 editor_ops.cc
138 editor_region_list.cc
139 editor_route_list.cc
140 editor_rulers.cc
141 editor_selection_list.cc
142 export_dialog.cc
143 gain_meter.cc
144 io_selector.cc
145 library_ui.cc
146 meter_bridge.cc
147 mixer_strip.cc
148 mixer_ui.cc
149 new_session_dialog.cc
150 option_editor.cc
151 panner_ui.cc
152 playlist_selector.cc
153 plugin_selector.cc
154 plugin_ui.cc
155 redirect_box.cc
156 regionview.cc
157 route_params_ui.cc
158 """)
159
160 extra_sources = []
161 vst_files = [ 'vst_pluginui.cc' ]
162
163 if env['VST']:
164    extra_sources += vst_files
165
166 gtkardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
167 gtkardour.Append(CXXFLAGS="-DDATA_DIR=\\\""+final_prefix+"/share\\\"")
168 gtkardour.Append(CXXFLAGS="-DLOCALEDIR=\\\""+final_prefix+"/share/locale\\\"")
169
170 versionflag = '-DVERSIONSTRING=\\\"' + env['VERSION'] + '\\\"'
171
172 gtkardour.Append(CXXFLAGS=versionflag)
173
174 gtkardour.VersionBuild(['version.cc','version.h'], 'SConscript')
175
176 executable = 'ardour.bin'
177
178 ardour = gtkardour.Program(target = executable, source = gtkardour_files + extra_sources)
179
180 Default(ardour)
181
182 if env['VERSIONED']:
183     Default (env.VersionedExecutable ('tagged_executable', ardour))
184
185 if env['NLS']:
186     i18n (gtkardour, gtkardour_files + extra_sources, env)
187
188 #install
189
190
191 env.Alias('install', env.InstallAs(os.path.join(install_prefix, 'bin')+'/ardour', ardour))
192 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour'), 'ardour_ui.rc'))
193 env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour'), 'splash.ppm'))
194
195 #dist
196 env.Alias ('tarball', env.Distribute (env['DISTTREE'],
197                                       [ 'SConscript',
198                                         'i18n.h', 'gettext.h',
199                                         'editor_xpms', 'misc_xpms', 'transport_xpms',
200                                         'ardour_ui.rc', 'splash.ppm'
201                                         ] +
202                                       gtkardour_files + vst_files +
203                                       glob.glob('po/*.po') + glob.glob('*.h')))
204
205 # generate a prototype full-featured ardour_ui.rc file
206
207 env.Alias ('protorc', env.Command ('proto.rc', gtkardour_files, """
208      grep set_name $SOURCES | \
209 sed 's/.*("\([a-zA-Z_][a-zA-Z_]*\)").*/\\1/' | \
210 grep -v '\\.' | sort | uniq | \
211 awk '/\\./ {} { printf ("style \\"%s\\"\\n{\\n\
212   fg[NORMAL] =   { 0, 0, 0 }\\n\
213   fg[ACTIVE] =   { 0, 0, 0 }\\n\
214   fg[SELECTED] = { 0, 0, 0 }\\n\
215   bg[NORMAL] =   { 0, 0, 0 }\\n\
216   bg[ACTIVE] =   { 0, 0, 0 }\\n\
217   bg[SELECTED] = { 0, 0, 0 }\\n\
218 }\\nwidget \\"*%s\\" style \\"%s\\"\\nwidget \\"*%s*\\" style \\"%s\\"\\n\\n", \
219   $$0, $$0, $$0, $$0, $$0) }' > $TARGET && \
220      grep 'color_map\[[a-zA-Z_][a-zA-Z]*\]' $SOURCES | \
221  sed 's/.*\[\([a-zA-Z_][a-zA-Z_]*\)].*/\\1/'| \
222  sort | uniq | \
223  awk '{ printf ("style \\"%s\\"\\n{\\n\
224   fg[NORMAL] =   { 0, 0, 0 }\\n\
225   fg[ACTIVE] =   { 0, 0, 0 }\\n\
226 }\\nwidget \\"*%s\\" style \\"%s\\"\\n \\n\\n", $$0, $$0, $$0) }' >> $TARGET ;
227 """
228 ))