-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
269 lines (237 loc) · 10.7 KB
/
CMakeLists.txt
File metadata and controls
269 lines (237 loc) · 10.7 KB
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
cmake_minimum_required(VERSION 3.22)
# Platform-specific configuration
if(APPLE)
# Force arm64 for Apple Silicon (macOS only)
set(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "Build architectures for macOS")
# Use Ninja generator on macOS if not specified
if(NOT CMAKE_GENERATOR)
find_program(NINJA_EXE ninja)
if(NINJA_EXE)
set(CMAKE_GENERATOR "Ninja" CACHE INTERNAL "")
endif()
endif()
elseif(WIN32)
# Use Visual Studio generator on Windows if not specified
if(NOT CMAKE_GENERATOR)
set(CMAKE_GENERATOR "Visual Studio 17 2022" CACHE INTERNAL "")
endif()
endif()
project(Matrix-Control VERSION 0.0.18)
# C++ Standard configuration
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Generate compile_commands.json for IDE support (clangd, etc.)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Reference JUCE from environment variable
if(DEFINED ENV{JUCE_DIR})
add_subdirectory($ENV{JUCE_DIR} "${CMAKE_BINARY_DIR}/JUCE")
else()
message(FATAL_ERROR "JUCE_DIR environment variable not set. Please set it to your JUCE installation path.")
endif()
# ============================================================================
# BINARY DATA (Fonts)
# ============================================================================
juce_add_binary_data(PluginFonts
HEADER_NAME PluginFontsData.h
NAMESPACE PluginFontsData
SOURCES
Assets/Fonts/PTSansNarrow-Regular.ttf
Assets/Fonts/PTSansNarrow-Bold.ttf
)
# ============================================================================
# SOURCE FILES
# Add your new .cpp files here (keep them sorted alphabetically for clarity)
# ============================================================================
set(PLUGIN_SOURCES
# Core
Source/Core/PluginProcessor.cpp
Source/Core/Factories/ApvtsFactory.cpp
Source/Core/Factories/ApvtsValidator.cpp
Source/Core/Factories/ApvtsLayoutBuilder.cpp
Source/Shared/Definitions/PluginHelpers.cpp
Source/Shared/Definitions/PluginDescriptors.cpp
Source/Shared/Definitions/PluginDescriptorsMasterEdit.cpp
Source/Shared/Definitions/PluginDescriptorsPatchEdit.cpp
Source/Shared/Definitions/PluginDescriptorsMatrixModulation.cpp
Source/Shared/Definitions/PluginDescriptorsPatchManager.cpp
Source/GUI/PluginEditor.cpp
Source/GUI/Factories/WidgetFactory.cpp
Source/GUI/Factories/WidgetFactoryValidator.cpp
# Core - MIDI Communication Layer
Source/Core/MIDI/Ports/MidiInputPort.cpp
Source/Core/MIDI/Ports/MidiOutputPort.cpp
Source/Core/MIDI/Transport/MidiSender.cpp
Source/Core/MIDI/Transport/MidiReceiver.cpp
Source/Core/MIDI/MidiManager.cpp
Source/Core/MIDI/SysEx/SysExParser.cpp
Source/Core/MIDI/SysEx/SysExDecoder.cpp
Source/Core/MIDI/SysEx/SysExEncoder.cpp
# GUI - Skins
Source/GUI/Skins/Skin.cpp
# GUI - Looks
Source/GUI/Looks/LookBuilders.cpp
# GUI - Main Component
Source/GUI/MainComponent.cpp
# GUI - Panels
Source/GUI/Panels/MainComponent/FooterPanel/FooterPanel.cpp
Source/GUI/Panels/MainComponent/HeaderPanel/HeaderPanel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/BodyPanel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/MasterEditPanel/MasterEditPanel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/MasterEditPanel/Modules/MidiPanel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/MasterEditPanel/Modules/MiscPanel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/MasterEditPanel/Modules/VibratoPanel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/MatrixModulationPanel/MatrixModulationPanel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/PatchEditPanel/BottomPanel/BottomPanel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/PatchEditPanel/BottomPanel/Modules/Env1Panel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/PatchEditPanel/BottomPanel/Modules/Env2Panel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/PatchEditPanel/BottomPanel/Modules/Env3Panel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/PatchEditPanel/BottomPanel/Modules/Lfo1Panel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/PatchEditPanel/BottomPanel/Modules/Lfo2Panel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/PatchEditPanel/MiddlePanel/MiddlePanel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/PatchEditPanel/PatchEditPanel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/PatchEditPanel/TopPanel/TopPanel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/PatchEditPanel/TopPanel/Modules/Dco1Panel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/PatchEditPanel/TopPanel/Modules/Dco2Panel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/PatchEditPanel/TopPanel/Modules/FmTrackPanel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/PatchEditPanel/TopPanel/Modules/RampPortamentoPanel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/PatchEditPanel/TopPanel/Modules/VcfVcaPanel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/PatchManagerPanel/PatchManagerPanel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/PatchManagerPanel/Modules/BankUtilityPanel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/PatchManagerPanel/Modules/InternalPatchesPanel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/PatchManagerPanel/Modules/ComputerPatchesPanel.cpp
Source/GUI/Panels/MainComponent/BodyPanel/PatchManagerPanel/Modules/PatchMutatorPanel.cpp
# GUI - Panels - Reusable
Source/GUI/Panels/Reusable/BaseModulePanel.cpp
Source/GUI/Panels/Reusable/ModuleHeaderPanel.cpp
Source/GUI/Panels/Reusable/ParameterPanel.cpp
Source/GUI/Panels/Reusable/ModulationBusPanel.cpp
# GUI - Widgets
Source/GUI/Widgets/Button.cpp
Source/GUI/Widgets/ComboBox.cpp
Source/GUI/Widgets/Toggle.cpp
Source/GUI/Widgets/EnvelopeDisplay.cpp
Source/GUI/Widgets/GroupLabel.cpp
Source/GUI/Widgets/HorizontalSeparator.cpp
Source/GUI/Widgets/Label.cpp
Source/GUI/Widgets/ModulationBusHeader.cpp
Source/GUI/Widgets/ModuleHeader.cpp
Source/GUI/Widgets/MultiColumnPopupMenu.cpp
Source/GUI/Widgets/NumberBox.cpp
Source/GUI/Widgets/PatchNameDisplay.cpp
Source/GUI/Widgets/PopupMenuBase.cpp
Source/GUI/Widgets/PopupMenuPositioner.cpp
Source/GUI/Widgets/PopupMenuRenderer.cpp
Source/GUI/Widgets/ScrollablePopupMenu.cpp
Source/GUI/Widgets/SectionHeader.cpp
Source/GUI/Widgets/Slider.cpp
Source/GUI/Widgets/TrackGeneratorDisplay.cpp
Source/GUI/Widgets/VerticalSeparator.cpp
# Loggers
Source/Core/Loggers/MidiLogger.cpp
Source/Core/Loggers/ApvtsLogger.cpp
# Quality - Unit Tests
Quality/Tests/Unit/MidiManagerTests.cpp
Quality/Tests/Unit/SysExEncoderTests.cpp
Quality/Tests/Unit/SysExParserTests.cpp
)
# ============================================================================
# PLUGIN CONFIGURATION
# ============================================================================
# Platform-specific plugin formats (filter out AU on Windows)
set(PLUGIN_FORMATS_LIST AU VST3 Standalone)
if(NOT APPLE)
# Remove AU from formats on non-Apple platforms
string(REPLACE "AU " "" PLUGIN_FORMATS_LIST "${PLUGIN_FORMATS_LIST}")
string(REPLACE " AU" "" PLUGIN_FORMATS_LIST "${PLUGIN_FORMATS_LIST}")
string(REPLACE "AU" "" PLUGIN_FORMATS_LIST "${PLUGIN_FORMATS_LIST}")
string(STRIP "${PLUGIN_FORMATS_LIST}" PLUGIN_FORMATS_LIST)
endif()
# Platform-specific COPY_PLUGIN_AFTER_BUILD setting
if(APPLE)
set(COPY_PLUGIN_AFTER_BUILD_VALUE TRUE)
else()
set(COPY_PLUGIN_AFTER_BUILD_VALUE FALSE)
endif()
juce_add_plugin(Matrix-Control
COMPANY_NAME "Ten Square Software"
BUNDLE_ID "com.TenSquareSoftware.Matrix-Control"
PLUGIN_MANUFACTURER_CODE Tssf
PLUGIN_CODE Mcpi
FORMATS ${PLUGIN_FORMATS_LIST}
PRODUCT_NAME "Matrix-Control"
PLUGIN_NAME "Matrix-Control"
IS_SYNTH FALSE
NEEDS_MIDI_INPUT TRUE
NEEDS_MIDI_OUTPUT TRUE
IS_MIDI_EFFECT FALSE
EDITOR_WANTS_KEYBOARD_FOCUS FALSE
COPY_PLUGIN_AFTER_BUILD ${COPY_PLUGIN_AFTER_BUILD_VALUE}
VST3_CATEGORIES Fx
AU_MAIN_TYPE kAudioUnitType_Effect
)
target_sources(Matrix-Control PRIVATE ${PLUGIN_SOURCES})
# Add Source directory as include directory to eliminate relative paths
target_include_directories(Matrix-Control
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/Source
)
target_link_libraries(Matrix-Control
PRIVATE
PluginFonts
juce::juce_audio_utils
juce::juce_dsp
juce::juce_gui_basics
PUBLIC
juce::juce_recommended_config_flags
juce::juce_recommended_lto_flags
juce::juce_recommended_warning_flags
)
target_compile_definitions(Matrix-Control
PUBLIC
JUCE_WEB_BROWSER=0
JUCE_USE_CURL=0
JUCE_VST3_CAN_REPLACE_VST2=0
JUCE_REPORT_APP_USAGE=0
)
# ============================================================================
# CUSTOM VST3 INSTALLATION (Windows)
# Copy VST3 plugin to custom folder after build for easy testing
# ============================================================================
#
# CONFIGURATION:
# ------------
# To customize the VST3 installation folder, modify the default value below
# or override it when configuring CMake:
# cmake .. -DCUSTOM_VST3_FOLDER="your/custom/path"
#
# Examples:
# - Personal folder: "C:/Users/YourName/VST3"
# - Custom location: "D:/MyPlugins/VST3"
# - Standard location (requires admin): "C:/Program Files/Common Files/VST3"
#
# Note: Using a personal folder avoids requiring administrator privileges.
# Configure your DAW to scan this custom folder for VST3 plugins.
#
# ============================================================================
if(WIN32)
# Define custom VST3 folder (can be overridden via CMake cache)
if(NOT DEFINED CUSTOM_VST3_FOLDER)
set(CUSTOM_VST3_FOLDER "C:/Users/YourName/VST3" CACHE PATH "Custom VST3 installation folder")
endif()
# VST3 target name (JUCE appends _VST3)
set(VST3_TARGET_NAME "Matrix-Control_VST3")
# Path where JUCE generates the VST3 bundle (using generator expression for CONFIG)
set(VST3_SOURCE_DIR "${CMAKE_BINARY_DIR}/Matrix-Control_artefacts/$<CONFIG>/VST3/Matrix-Control.vst3")
set(VST3_DEST_DIR "${CUSTOM_VST3_FOLDER}/Matrix-Control.vst3")
# Add custom command to copy VST3 plugin after build
add_custom_command(TARGET ${VST3_TARGET_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo "Copying VST3 plugin to custom folder: ${CUSTOM_VST3_FOLDER}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${CUSTOM_VST3_FOLDER}"
COMMAND ${CMAKE_COMMAND} -E remove_directory "${VST3_DEST_DIR}"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${VST3_SOURCE_DIR}" "${VST3_DEST_DIR}"
COMMENT "Installing VST3 plugin to custom folder"
VERBATIM
)
message(STATUS "VST3 plugin will be copied to: ${CUSTOM_VST3_FOLDER}")
endif()