-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
361 lines (313 loc) · 10.3 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
cmake_minimum_required(VERSION 3.25)
# Windows RunTime Library
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
# Set universal binary build on MacOS
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
# Set macOS target deployment version
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0")
# Define project
project(mrta
VERSION 0.0.1
LANGUAGES C CXX)
# Xcode 15 linker workaround
# If you are using Link Time Optimisation (LTO), the new linker introduced in Xcode 15 may produce a broken binary.
# As a workaround, add either '-Wl,-weak_reference_mismatches,weak' or '-Wl,-ld_classic' to your linker flags.
# Once you've selected a workaround, you can add JUCE_SILENCE_XCODE_15_LINKER_WARNING to your preprocessor definitions to silence this warning.
if(APPLE)
set(xcode_15_linker -Wl,-ld_classic)
endif()
# Some windows specific defines
if (WIN32)
set(windows_defines _USE_MATH_DEFINES WIN32_LEAN_AND_MEAN)
endif()
# Add JUCE
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/dependencies/JUCE)
# Add MRTA module
juce_add_module(${CMAKE_CURRENT_SOURCE_DIR}/modules/mrta_utils)
# General variables
# You should change this to something more interesting
set(company_name "Modern Real-Time Audio")
set(company_copyright "Modern Real-Time Audio Oy")
set(company_code "Mrta")
set(company_bundle_id "com.ModernRealTimeAudio")
# This function adds a JUCE plugin target to this project
# Arguments:
# - TARGET: The name of your plugin target, this allows you to identify which of your plugins will be built.
# - VERSION: Version on your plugin.
# - PLUGIN_NAME: The name which will be displayed on the DAW.
# - PROD_NAME: Internal product name, cannot contain whitespace.
# - PROD_CODE: 4 letter code unique identifier to your plugin, at least 1 capitalized letter.
# - SYNTH: Set to true if your plugin is a synth, false otherwise.
# - SOURCES: A list of all the source files of you plugin.
# - INCLUDE_DIRS: A list of the include directories required by your sources.
function(add_plugin target)
# parse input args
set(one_value_args TARGET VERSION PLUGIN_NAME PROD_NAME PROD_CODE SYNTH)
set(multi_value_args SOURCES INCLUDE_DIRS)
cmake_parse_arguments(AP "" "${one_value_args}" "${multi_value_args}" ${ARGN})
# info and debug
message(STATUS "Adding JUCE plugin target: ${target}")
message(STATUS " PLUGIN_NAME: ${AP_PLUGIN_NAME}")
message(STATUS " VERSION: ${AP_VERSION}")
message(STATUS " PROD_NAME: ${AP_PROD_NAME}")
message(STATUS " PROD_CODE: ${AP_PROD_CODE}")
message(STATUS " SYNTH: ${AP_SYNTH}")
## Too verbose, uncomment just if you need to debug...
#message(STATUS " SOURCES: ${AP_SOURCES}")
#message(STATUS " INCLUDE_DIRS: ${AP_INCLUDE_DIRS}")
# Add juce plugin target
juce_add_plugin(${target}
PRODUCT_NAME ${AP_PROD_NAME}
VERSION ${AP_VERSION}
MICROPHONE_PERMISSION_ENABLED TRUE
COMPANY_COPYRIGHT ${company_copyright}
COMPANY_NAME ${company_name}
FORMATS Standalone VST3 AU Standalone
PLUGIN_NAME ${AP_PLUGIN_NAME}
PLUGIN_MANUFACTURER_CODE ${company_code}
PLUGIN_CODE ${AP_PROD_CODE}
BUNDLE_ID ${company_bundle_id}.${AP_PROD_NAME}
IS_SYNTH ${AP_SYNTH}
NEEDS_MIDI_INPUT ${AP_SYNTH}
NEEDS_MIDI_OUTPUT FALSE
COPY_PLUGIN_AFTER_BUILD TRUE)
juce_generate_juce_header(${target})
target_sources(${target}
PRIVATE
${AP_SOURCES})
target_include_directories(${target}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/dependencies/asiosdk/common
${AP_INCLUDE_DIRS})
target_compile_features(${target}
PUBLIC
cxx_std_17)
target_compile_definitions(${target}
PRIVATE
JUCE_ASIO=1 JUCE_DIRECTSOUND=0 JUCE_USE_FLAC=0 JUCE_USE_OGGVORBIS=0
JUCE_USE_WINDOWS_MEDIA_FORMAT=0 JUCE_WEB_BROWSER=0
JUCE_VST3_CAN_REPLACE_VST2=0 JUCE_SILENCE_XCODE_15_LINKER_WARNING=1
${windows_defines})
target_link_libraries(${target}
PRIVATE
juce::juce_audio_utils
juce::juce_dsp
mrta_utils
PUBLIC
${xcode_15_linker}
juce::juce_recommended_config_flags
juce::juce_recommended_lto_flags)
endfunction(add_plugin)
## Plugin projects
set(dsp_source ${CMAKE_CURRENT_SOURCE_DIR}/projects/DSP)
set(gui_source ${CMAKE_CURRENT_SOURCE_DIR}/projects/GUI)
# add example project
set(mfrtaa_source ${CMAKE_CURRENT_SOURCE_DIR}/projects/MyFirstRealTimeAudioApp)
add_plugin(mfrtaa
VERSION 0.1.0
PLUGIN_NAME "My First RT Audio App"
PROD_NAME MyFirstRTAudioApp
PROD_CODE Rtap
SYNTH FALSE
SOURCES
${mfrtaa_source}/PluginEditor.cpp
${mfrtaa_source}/PluginProcessor.cpp
INCLUDE_DIRS
${mfrtaa_source})
# ring mod project
set(ringmod_source ${CMAKE_CURRENT_SOURCE_DIR}/projects/RingModulator)
add_plugin(ringmod
VERSION 0.1.0
PLUGIN_NAME "Ring Modulator"
PROD_NAME RingModulator
PROD_CODE Rmod
SYNTH FALSE
SOURCES
${ringmod_source}/PluginEditor.cpp
${ringmod_source}/PluginProcessor.cpp
${dsp_source}/RingMod.cpp
INCLUDE_DIRS
${dsp_source}
${ringmod_source})
# parametric eq project
set(parameq_source ${CMAKE_CURRENT_SOURCE_DIR}/projects/ParametricEQ)
add_plugin(parameq
VERSION 0.1.0
PLUGIN_NAME "Parametric EQ"
PROD_NAME ParametricEQ
PROD_CODE Pmeq
SYNTH FALSE
SOURCES
${parameq_source}/PluginEditor.cpp
${parameq_source}/PluginProcessor.cpp
${dsp_source}/Biquad.cpp
${dsp_source}/ParametricEqualizer.cpp
${gui_source}/MrtaLAF.cpp
INCLUDE_DIRS
${gui_source}
${dsp_source}
${ringmod_source})
# flanger project
set(flanger_source ${CMAKE_CURRENT_SOURCE_DIR}/projects/Flanger)
add_plugin(flanger
VERSION 0.1.0
PLUGIN_NAME "Flanger"
PROD_NAME Flanger
PROD_CODE Flng
SYNTH FALSE
SOURCES
${flanger_source}/PluginEditor.cpp
${flanger_source}/PluginProcessor.cpp
${dsp_source}/DelayLine.cpp
${dsp_source}/Flanger.cpp
INCLUDE_DIRS
${dsp_source}
${flanger_source})
# Velvet Reverb Project
set(velvetreverb_source ${CMAKE_CURRENT_SOURCE_DIR}/projects/VelvetReverb)
add_plugin(velvetreverb
VERSION 0.1.0
PLUGIN_NAME "Velvet Reverb"
PROD_NAME Velvet Reverb
PROD_CODE Vtrb
SYNTH FALSE
SOURCES
${velvetreverb_source}/PluginEditor.cpp
${velvetreverb_source}/PluginProcessor.cpp
${dsp_source}/MultiTapDelayLine.cpp
${dsp_source}/VelvetReverb.cpp
INCLUDE_DIRS
${dsp_source}
${velvetreverb_source})
# delay project
set(delay_source ${CMAKE_CURRENT_SOURCE_DIR}/projects/Delay)
add_plugin(delay
VERSION 0.1.0
PLUGIN_NAME "Delay"
PROD_NAME Delay
PROD_CODE Dlay
SYNTH FALSE
SOURCES
${delay_source}/PluginEditor.cpp
${delay_source}/PluginProcessor.cpp
${dsp_source}/DelayLine.cpp
${dsp_source}/Delay.cpp
${dsp_source}/Biquad.cpp
${dsp_source}/ParametricEqualizer.cpp
${dsp_source}/Meter.cpp
${gui_source}/MeterComponent.cpp
INCLUDE_DIRS
${dsp_source}
${gui_source}
${delay_source})
# osc project
set(osc_source ${CMAKE_CURRENT_SOURCE_DIR}/projects/Oscillators)
add_plugin(osc
VERSION 0.1.0
PLUGIN_NAME "Oscillators"
PROD_NAME Oscillators
PROD_CODE Oscs
SYNTH FALSE
SOURCES
${osc_source}/PluginEditor.cpp
${osc_source}/PluginProcessor.cpp
${dsp_source}/Oscillator.cpp
INCLUDE_DIRS
${dsp_source}
${osc_source})
# midi handling project
set(midi_source ${CMAKE_CURRENT_SOURCE_DIR}/projects/MidiHandler)
add_plugin(midi
VERSION 0.1.0
PLUGIN_NAME "Midi Handler"
PROD_NAME MidiHandler
PROD_CODE Mdhd
SYNTH TRUE
SOURCES
${midi_source}/PluginEditor.cpp
${midi_source}/PluginProcessor.cpp
${dsp_source}/SynthVoice.cpp
${dsp_source}/Oscillator.cpp
INCLUDE_DIRS
${dsp_source}
${midi_source})
# envelope generator project
set(envgen_source ${CMAKE_CURRENT_SOURCE_DIR}/projects/EnvelopeGenerator)
add_plugin(envgen
VERSION 0.1.0
PLUGIN_NAME "Envelope Generator"
PROD_NAME EnvelopeGenerator
PROD_CODE Egen
SYNTH FALSE
SOURCES
${envgen_source}/PluginEditor.cpp
${envgen_source}/PluginProcessor.cpp
${dsp_source}/EnvelopeGenerator.cpp
INCLUDE_DIRS
${dsp_source}
${envgen_source})
# state variable filter project
set(svf_source ${CMAKE_CURRENT_SOURCE_DIR}/projects/StateVariableFilter)
add_plugin(svf
VERSION 0.1.0
PLUGIN_NAME "State Variable Filter"
PROD_NAME StateVariableFilter
PROD_CODE Svff
SYNTH FALSE
SOURCES
${svf_source}/PluginEditor.cpp
${svf_source}/PluginProcessor.cpp
${dsp_source}/StateVariableFilter.cpp
${dsp_source}/Oscillator.cpp
INCLUDE_DIRS
${dsp_source}
${svf_source})
# Dark Velvet Reverb Project
set(darkvelvetreverb_source ${CMAKE_CURRENT_SOURCE_DIR}/projects/DarkVelvetReverb)
add_plugin(darkvelvetreverb
VERSION 0.1.0
PLUGIN_NAME "DarkVelvetReverb"
PROD_NAME Dark Velvet Reverb
PROD_CODE dvnr
SYNTH FALSE
SOURCES
${darkvelvetreverb_source}/PluginEditor.cpp
${darkvelvetreverb_source}/PluginProcessor.cpp
${darkvelvetreverb_source}/DvnParams.cpp
${dsp_source}/VelvetConvolver.cpp
${dsp_source}/Allpole.cpp
${dsp_source}/DarkVelvetReverb.cpp
${dsp_source}/ParametricEqualizer.cpp
${dsp_source}/Biquad.cpp
INCLUDE_DIRS
${dsp_source}
${darkvelvetreverb_source})
# RING MOD HW
set(rm_source ${CMAKE_CURRENT_SOURCE_DIR}/HW/LiRingMod)
add_plugin(rm
VERSION 0.1.0
PLUGIN_NAME "rm"
PROD_NAME rm
PROD_CODE rmhw
SYNTH FALSE
SOURCES
${rm_source}/PluginEditor.cpp
${rm_source}/PluginProcessor.cpp
INCLUDE_DIRS
${rm_source})
# DELAY HW
set(fbDelay_source ${CMAKE_CURRENT_SOURCE_DIR}/HW/LiDelay)
add_plugin(fbDelay
VERSION 0.1.0
PLUGIN_NAME "FB delay"
PROD_NAME fbDelay
PROD_CODE fbdl
SYNTH FALSE
SOURCES
${fbDelay_source}/PluginEditor.cpp
${fbDelay_source}/PluginProcessor.cpp
${dsp_source}/DelayLine.cpp
${fbDelay_source}/Flanger.cpp
INCLUDE_DIRS
${fbDelay_source}
${dsp_source})