new registration system for editor actions set up and compiles
[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 about.cc
52 add_route_dialog.cc
53 ardour_dialog.cc
54 ardour_message.cc
55 ardour_ui.cc
56 ardour_ui2.cc
57 ardour_ui_dependents.cc
58 ardour_ui_dialogs.cc
59 ardour_ui_ed.cc
60 ardour_ui_mixer.cc
61 audio_clock.cc
62 audio_time_axis.cc
63 automation_gain_line.cc
64 automation_line.cc
65 automation_pan_line.cc
66 automation_time_axis.cc
67 axis_view.cc
68 canvas-imageframe.cc
69 canvas-ruler.c
70 canvas-simpleline.c
71 canvas-simplerect.c
72 canvas-waveview.c
73 connection_editor.cc
74 crossfade_edit.cc
75 crossfade_view.cc
76 curvetest.cc
77 default_keys.cc
78 editing.cc
79 editor.cc
80 editor_actions.cc
81 editor_audiotrack.cc
82 editor_canvas_events.cc
83 editor_cursors.cc
84 editor_edit_groups.cc
85 editor_export_audio.cc
86 editor_hscroller.cc
87 editor_imageframe.cc
88 editor_keyboard.cc
89 editor_keys.cc
90 editor_markers.cc
91 editor_mixer.cc
92 editor_mouse.cc
93 editor_nudge.cc
94 editor_ops.cc
95 editor_region_list.cc
96 editor_route_list.cc
97 editor_rulers.cc
98 editor_scrub.cc
99 editor_selection_list.cc
100 editor_tempodisplay.cc
101 editor_timefx.cc
102 export_dialog.cc
103 gain_automation_time_axis.cc
104 gain_meter.cc
105 ghostregion.cc
106 grouped_buttons.cc
107 gtk-custom-hruler.c
108 gtk-custom-ruler.c
109 imageframe_socket_handler.cc
110 imageframe_time_axis.cc
111 imageframe_time_axis_group.cc
112 imageframe_time_axis_view.cc
113 imageframe_view.cc
114 io_selector.cc
115 keyboard.cc
116 keyboard_target.cc
117 library_ui.cc
118 location_ui.cc
119 main.cc
120 marker.cc
121 marker_time_axis.cc
122 marker_time_axis_view.cc
123 marker_view.cc
124 meter_bridge.cc
125 meter_bridge_strip.cc
126 mixer_strip.cc
127 mixer_ui.cc
128 new_session_dialog.cc
129 option_editor.cc
130 opts.cc
131 pan_automation_time_axis.cc
132 panner2d.cc
133 panner_ui.cc
134 playlist_selector.cc
135 plugin_selector.cc
136 plugin_ui.cc
137 prompter.cc
138 public_editor.cc
139 redirect_automation_line.cc
140 redirect_automation_time_axis.cc
141 redirect_box.cc
142 region_editor.cc
143 region_gain_line.cc
144 region_selection.cc
145 regionview.cc
146 route_params_ui.cc
147 route_redirect_selection.cc
148 route_ui.cc
149 selection.cc
150 send_ui.cc
151 streamview.cc
152 tempo_dialog.cc
153 time_axis_view.cc
154 time_axis_view_item.cc
155 time_selection.cc
156 utils.cc
157 version.cc
158 visual_time_axis.cc
159 """)
160
161 mtest_files=Split("""
162 mtest.cc
163 """)
164
165 extra_sources = []
166 vst_files = [ 'vst_pluginui.cc' ]
167
168 if env['VST']:
169    extra_sources += vst_files
170
171 gtkardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
172 gtkardour.Append(CXXFLAGS="-DDATA_DIR=\\\""+final_prefix+"/share\\\"")
173 gtkardour.Append(CXXFLAGS="-DLOCALEDIR=\\\""+final_prefix+"/share/locale\\\"")
174
175 versionflag = '-DVERSIONSTRING=\\\"' + env['VERSION'] + '\\\"'
176
177 gtkardour.Append(CXXFLAGS=versionflag)
178
179 gtkardour.VersionBuild(['version.cc','version.h'], 'SConscript')
180
181 executable = 'ardour.bin'
182
183 ardour = gtkardour.Program(target = executable, source = gtkardour_files + extra_sources)
184 mtest = gtkardour.Program(target = 'mtest', source = mtest_files)
185
186 Default(ardour)
187
188 if env['VERSIONED']:
189     Default (env.VersionedExecutable ('tagged_executable', ardour))
190
191 if env['NLS']:
192     i18n (gtkardour, gtkardour_files + extra_sources, env)
193
194 #install
195
196
197 env.Alias('install', env.InstallAs(os.path.join(install_prefix, 'bin')+'/ardour', ardour))
198 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour'), 'ardour_ui.rc'))
199 env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour'), 'splash.ppm'))
200
201 #dist
202 env.Alias ('tarball', env.Distribute (env['DISTTREE'],
203                                       [ 'SConscript',
204                                         'i18n.h', 'gettext.h',
205                                         'editor_xpms', 'misc_xpms', 'transport_xpms',
206                                         'ardour_ui.rc', 'splash.ppm'
207                                         ] +
208                                       gtkardour_files + vst_files +
209                                       glob.glob('po/*.po') + glob.glob('*.h')))
210
211 # generate a prototype full-featured ardour_ui.rc file
212
213 env.Alias ('protorc', env.Command ('proto.rc', gtkardour_files, """
214      grep set_name $SOURCES | \
215 sed 's/.*("\([a-zA-Z_][a-zA-Z_]*\)").*/\\1/' | \
216 grep -v '\\.' | sort | uniq | \
217 awk '/\\./ {} { printf ("style \\"%s\\"\\n{\\n\
218   fg[NORMAL] =   { 0, 0, 0 }\\n\
219   fg[ACTIVE] =   { 0, 0, 0 }\\n\
220   fg[SELECTED] = { 0, 0, 0 }\\n\
221   bg[NORMAL] =   { 0, 0, 0 }\\n\
222   bg[ACTIVE] =   { 0, 0, 0 }\\n\
223   bg[SELECTED] = { 0, 0, 0 }\\n\
224 }\\nwidget \\"*%s\\" style \\"%s\\"\\nwidget \\"*%s*\\" style \\"%s\\"\\n\\n", \
225   $$0, $$0, $$0, $$0, $$0) }' > $TARGET && \
226      grep 'color_map\[[a-zA-Z_][a-zA-Z]*\]' $SOURCES | \
227  sed 's/.*\[\([a-zA-Z_][a-zA-Z_]*\)].*/\\1/'| \
228  sort | uniq | \
229  awk '{ printf ("style \\"%s\\"\\n{\\n\
230   fg[NORMAL] =   { 0, 0, 0 }\\n\
231   fg[ACTIVE] =   { 0, 0, 0 }\\n\
232 }\\nwidget \\"*%s\\" style \\"%s\\"\\n \\n\\n", $$0, $$0, $$0) }' >> $TARGET ;
233 """
234 ))