forked from jpcima/DelayArchitect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
276 lines (254 loc) · 8.89 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
cmake_minimum_required(VERSION 3.7)
project(DelayArchitect VERSION "0.0.1" LANGUAGES C CXX)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(BuildType)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_VISIBILITY_PRESET "hidden")
set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
if(WIN32)
add_definitions("-DNOMINMAX=1")
add_definitions("-D_USE_MATH_DEFINES=1")
endif()
if(MSVC)
add_compile_options("/utf-8")
endif()
find_package(PkgConfig)
add_subdirectory("thirdparty/JUCE" EXCLUDE_FROM_ALL)
juce_add_module("thirdparty/fontaudio/wrappers/juce/module/fontaudio")
option(GD_COPY_AFTER_BUILD "Copy after build" OFF)
option(GD_BENCHMARKS "Build benchmarks" OFF)
set(GD_PITCH_SHIFTER_TYPE "SuperCollider" CACHE STRING "Pitch shifter implementation to use")
set_property(CACHE GD_PITCH_SHIFTER_TYPE PROPERTY STRINGS "SuperCollider" "SoundTouch" "Simple")
###
add_library(jsl INTERFACE)
target_include_directories(jsl INTERFACE "thirdparty/jsl/include")
###
juce_add_plugin(DelayArchitect
PLUGIN_CODE Gdly
PLUGIN_MANUFACTURER_CODE Jpci
PRODUCT_NAME "Delay Architect"
COMPANY_NAME "Jean Pierre Cimalando"
FORMATS AU VST3
IS_SYNTH FALSE
NEEDS_MIDI_INPUT FALSE
NEEDS_MIDI_OUTPUT FALSE
IS_MIDI_EFFECT FALSE
EDITOR_WANTS_KEYBOARD_FOCUS FALSE
VST3_CATEGORIES "Fx Delay"
AU_MAIN_TYPE "kAudioUnitType_Effect"
COPY_PLUGIN_AFTER_BUILD "${GD_COPY_AFTER_BUILD}"
NEEDS_CURL FALSE
NEEDS_WEB_BROWSER FALSE)
target_compile_definitions(DelayArchitect
PUBLIC
"JUCE_WEB_BROWSER=0"
"JUCE_USE_CURL=0"
"JUCE_VST3_CAN_REPLACE_VST2=0"
"JUCE_DISPLAY_SPLASH_SCREEN=0")
target_include_directories(DelayArchitect
PRIVATE
"sources")
target_sources(DelayArchitect
PRIVATE
"sources/processor/Processor.h"
"sources/processor/Processor.cpp"
"sources/processor/PresetFile.h"
"sources/processor/PresetFile.cpp"
"sources/editor/Editor.h"
"sources/editor/Editor.cpp"
"sources/editor/LookAndFeel.h"
"sources/editor/LookAndFeel.cpp"
"sources/editor/parts/MainComponent.h"
"sources/editor/parts/MainComponent.cpp"
"sources/editor/parts/AboutComponent.h"
"sources/editor/parts/AboutComponent.cpp"
"sources/editor/parts/TapEditScreen.h"
"sources/editor/parts/TapEditScreen.cpp"
"sources/editor/parts/TapSlider.h"
"sources/editor/parts/TapSlider.cpp"
"sources/editor/parts/AdvancedTooltipWindow.h"
"sources/editor/parts/AdvancedTooltipWindow.cpp"
"sources/editor/parts/BetterSlider.h"
"sources/editor/parts/BetterSlider.cpp"
"sources/editor/parts/FadGlyphButton.h"
"sources/editor/parts/FadGlyphButton.cpp"
"sources/editor/parts/SVGGlyphButton.h"
"sources/editor/parts/SVGGlyphButton.cpp"
"sources/editor/attachments/TapParameterAttachment.h"
"sources/editor/attachments/TapParameterAttachment.cpp"
"sources/editor/attachments/GridParameterAttachment.h"
"sources/editor/attachments/GridParameterAttachment.cpp"
"sources/editor/attachments/AutomaticComboBoxParameterAttachment.h"
"sources/editor/attachments/AutomaticComboBoxParameterAttachment.cpp"
"sources/editor/attachments/InvertedButtonParameterAttachment.h"
"sources/editor/attachments/InvertedButtonParameterAttachment.cpp"
"sources/editor/attachments/SliderParameterAttachmentWithTooltip.h"
"sources/editor/attachments/SliderParameterAttachmentWithTooltip.cpp"
"sources/editor/attachments/ComboBoxParameterAttachmentByID.h"
"sources/editor/attachments/ComboBoxParameterAttachmentByID.cpp"
"sources/editor/importer/Importer.cpp"
"sources/editor/importer/Importer.h"
"sources/editor/importer/ImporterPST.cpp"
"sources/editor/importer/ImporterPST.h"
"sources/editor/utility/FunctionalTimer.h"
"sources/editor/utility/CommonPrefix.h"
"sources/editor/utility/CommonPrefix.cpp"
"sources/utility/AutoDeletePool.h"
"sources/utility/AutoDeletePool.hpp")
juce_add_binary_data(DelayArchitectResources
SOURCES
"resources/fonts/LiberationSans-Regular.ttf"
"resources/fonts/LiberationSans-Bold.ttf")
target_link_libraries(DelayArchitect
PRIVATE
DelayArchitectResources
juce::juce_audio_processors
juce::juce_opengl
juce::juce_recommended_config_flags
juce::juce_recommended_lto_flags
juce::juce_recommended_warning_flags)
if(MSVC)
target_compile_options(DelayArchitect PRIVATE "/fp:fast")
else()
target_compile_options(DelayArchitect PRIVATE "-ffast-math")
endif()
###
add_library(Gd STATIC
"sources/gd/Gd.cpp"
"sources/gd/Gd.h"
"sources/gd/GdDefs.cpp"
"sources/gd/GdDefs.h"
"sources/gd/GdJuce.h"
"sources/gd/GdLine.cpp"
"sources/gd/GdLine.h"
"sources/gd/GdNetwork.cpp"
"sources/gd/GdNetwork.h"
"sources/gd/GdTapFx.cpp"
"sources/gd/GdTapFx.h"
"sources/gd/GdFilter.cpp"
"sources/gd/GdFilter.h"
"sources/gd/GdFilter.hpp"
"sources/gd/GdShifter.cpp"
"sources/gd/GdShifter.h"
"sources/gd/filters/GdFilterAA.cpp"
"sources/gd/filters/GdFilterAA.h"
"sources/gd/filters/GdFilterAA.hpp"
"sources/gd/shifters/GdShifterSimple.cpp"
"sources/gd/shifters/GdShifterSimple.h"
"sources/gd/shifters/GdShifterSimple.hpp"
"sources/gd/shifters/GdShifterSoundTouch.cpp"
"sources/gd/shifters/GdShifterSoundTouch.h"
"sources/gd/shifters/GdShifterSuperCollider.cpp"
"sources/gd/shifters/GdShifterSuperCollider.h"
"sources/gd/utility/LinearSmoother.cpp"
"sources/gd/utility/LinearSmoother.h"
"sources/gd/utility/Clamp.h"
"sources/gd/utility/NextPowerOfTwo.h"
"sources/gd/utility/Volume.h"
"sources/gd/utility/CubicNL.h"
"sources/gd/utility/RsqrtNL.h"
"sources/gd/utility/StdcLocale.cpp"
"sources/gd/utility/StdcLocale.h"
"sources/gd/utility/StdcLocale.hpp")
set_source_files_properties(
"sources/gd/shifters/GdShifterSimple.cpp"
"sources/gd/shifters/GdShifterSoundTouch.cpp"
"sources/gd/shifters/GdShifterSuperCollider.cpp"
PROPERTIES
HEADER_FILE_ONLY ON)
target_include_directories(Gd
PUBLIC
"sources/gd"
"sources/appconfig")
###
target_link_libraries(DelayArchitect
PRIVATE
Gd
fontaudio)
###
add_library(simde INTERFACE)
target_include_directories(simde
INTERFACE
"thirdparty/simde")
###
target_link_libraries(Gd
PRIVATE
simde
jsl)
###
find_package(OpenMP)
if(OPENMP_FOUND)
add_library(openmp INTERFACE)
# OpenMP flags are provided as a space-separated string, we need a list
if(NOT CMAKE_VERSION VERSION_LESS 3.9)
separate_arguments(OpenMP_C_OPTIONS NATIVE_COMMAND "${OpenMP_C_FLAGS}")
separate_arguments(OpenMP_CXX_OPTIONS NATIVE_COMMAND "${OpenMP_CXX_FLAGS}")
elseif(CMAKE_HOST_WIN32)
separate_arguments(OpenMP_C_OPTIONS WINDOWS_COMMAND "${OpenMP_C_FLAGS}")
separate_arguments(OpenMP_CXX_OPTIONS WINDOWS_COMMAND "${OpenMP_CXX_FLAGS}")
else()
separate_arguments(OpenMP_C_OPTIONS UNIX_COMMAND "${OpenMP_C_FLAGS}")
separate_arguments(OpenMP_CXX_OPTIONS UNIX_COMMAND "${OpenMP_CXX_FLAGS}")
endif()
target_compile_options(openmp INTERFACE
$<$<COMPILE_LANGUAGE:C>:${OpenMP_C_OPTIONS}>
$<$<COMPILE_LANGUAGE:CXX>:${OpenMP_CXX_OPTIONS}>)
endif()
###
if(TARGET openmp)
target_link_libraries(Gd
PRIVATE
openmp)
endif()
###
add_library(SoundTouch STATIC EXCLUDE_FROM_ALL
"thirdparty/SoundTouch/source/SoundTouch/AAFilter.cpp"
"thirdparty/SoundTouch/source/SoundTouch/BPMDetect.cpp"
"thirdparty/SoundTouch/source/SoundTouch/cpu_detect_x86.cpp"
"thirdparty/SoundTouch/source/SoundTouch/FIFOSampleBuffer.cpp"
"thirdparty/SoundTouch/source/SoundTouch/FIRFilter.cpp"
"thirdparty/SoundTouch/source/SoundTouch/InterpolateCubic.cpp"
"thirdparty/SoundTouch/source/SoundTouch/InterpolateLinear.cpp"
"thirdparty/SoundTouch/source/SoundTouch/InterpolateShannon.cpp"
"thirdparty/SoundTouch/source/SoundTouch/mmx_optimized.cpp"
"thirdparty/SoundTouch/source/SoundTouch/PeakFinder.cpp"
"thirdparty/SoundTouch/source/SoundTouch/RateTransposer.cpp"
"thirdparty/SoundTouch/source/SoundTouch/SoundTouch.cpp"
"thirdparty/SoundTouch/source/SoundTouch/sse_optimized.cpp"
"thirdparty/SoundTouch/source/SoundTouch/TDStretch.cpp")
target_compile_definitions(SoundTouch
PUBLIC
"CMAKE"
"SOUNDTOUCH_FLOAT_SAMPLES=1"
"SOUNDTOUCH_USE_NEON=1")
target_include_directories(SoundTouch
PUBLIC
"thirdparty/SoundTouch/include")
###
if(GD_PITCH_SHIFTER_TYPE STREQUAL "SoundTouch")
target_compile_definitions(Gd
PRIVATE
"GD_USE_SOUNDTOUCH_PITCH_SHIFTER=1")
target_link_libraries(Gd
PRIVATE
SoundTouch)
elseif(GD_PITCH_SHIFTER_TYPE STREQUAL "SuperCollider")
target_compile_definitions(Gd
PRIVATE
"GD_USE_SUPERCOLLIDER_PITCH_SHIFTER=1")
elseif(GD_PITCH_SHIFTER_TYPE STREQUAL "Simple")
target_compile_definitions(Gd
PRIVATE
"GD_USE_SIMPLE_PITCH_SHIFTER=1")
else()
message(FATAL_ERROR "Invalid value for pitch shifter")
endif()
###
if(GD_BENCHMARKS)
pkg_check_modules(benchmark "benchmark" REQUIRED IMPORTED_TARGET)
add_executable(GdBenchmarkLinearSmoother "benchmarks/LinearSmoother.cpp")
target_link_libraries(GdBenchmarkLinearSmoother PRIVATE Gd PkgConfig::benchmark simde)
endif()