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