-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
278 lines (247 loc) · 9.39 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
cmake_minimum_required(VERSION 3.25)
project(XenSequencer VERSION 0.3.0)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_subdirectory(external/signals-light)
add_subdirectory(external/MicrotonalStepSequencer)
add_subdirectory(external/JUCE SYSTEM)
add_subdirectory(external/JUCE/extras/AudioPluginHost SYSTEM)
add_subdirectory(external/yaml-cpp SYSTEM)
add_subdirectory(external/json SYSTEM)
if (NOT TARGET Catch2)
add_subdirectory(external/Catch2 SYSTEM)
endif()
# XenSequencer Code - separate library so can be linked to tests and tools.
add_library(XenSequencerLib STATIC)
target_include_directories(XenSequencerLib
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
)
target_compile_options(XenSequencerLib INTERFACE
$<$<CXX_COMPILER_ID:MSVC>:/W1>
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Wextra -Wpedantic>
)
# Add key config files as a binary resource
juce_add_binary_data(EmbedKeys
HEADER_NAME "embed_keys.hpp"
NAMESPACE embed_keys
SOURCES
data/keys/keys.yml
data/keys/user_keys.yml
)
# Add scale files as a binary resource
juce_add_binary_data(EmbedScales
HEADER_NAME "embed_scales.hpp"
NAMESPACE embed_scales
SOURCES
data/scales/scales.yml
data/scales/user_scales.yml
)
# Add chord files as a binary resource
juce_add_binary_data(EmbedChords
HEADER_NAME "embed_chords.hpp"
NAMESPACE embed_chords
SOURCES
data/chords/chords.yml
data/chords/user_chords.yml
)
# Add demo files as a binary resource
juce_add_binary_data(EmbedDemos
HEADER_NAME "embed_demos.hpp"
NAMESPACE embed_demos
SOURCES
"data/demos/by this river.xss"
"data/demos/in a landscape.xss"
)
# Add font files as a binary resource
juce_add_binary_data(EmbedFonts
HEADER_NAME "embed_fonts.hpp"
NAMESPACE embed_fonts
SOURCES
data/font/NotoSansSymbols2-Regular.ttf
data/font/SourceCodePro-Black.ttf
data/font/SourceCodePro-Bold.ttf
data/font/SourceCodePro-ExtraBold.ttf
data/font/SourceCodePro-ExtraLight.ttf
data/font/SourceCodePro-Light.ttf
data/font/SourceCodePro-Medium.ttf
data/font/SourceCodePro-Regular.ttf
data/font/SourceCodePro-SemiBold.ttf
data/font/RobotoMono-Bold.ttf
data/font/RobotoMono-ExtraLight.ttf
data/font/RobotoMono-Light.ttf
data/font/RobotoMono-Medium.ttf
data/font/RobotoMono-Regular.ttf
data/font/RobotoMono-SemiBold.ttf
data/font/RobotoMono-Thin.ttf
)
target_link_libraries(XenSequencerLib
PUBLIC
sequencer
signals-light
juce::juce_audio_utils
yaml-cpp
nlohmann_json::nlohmann_json
EmbedKeys
EmbedScales
EmbedChords
EmbedDemos
EmbedFonts
juce::juce_recommended_config_flags
juce::juce_recommended_lto_flags
juce::juce_recommended_warning_flags
)
target_sources(XenSequencerLib
PUBLIC
src/actions.cpp
src/chord.cpp
src/command.cpp
src/command_history.cpp
src/copy_paste.cpp
src/input_mode.cpp
src/key_core.cpp
src/message_level.cpp
src/midi.cpp
src/midi_engine.cpp
src/modulators.cpp
src/scale.cpp
src/selection.cpp
src/user_directory.cpp
src/utility.cpp
src/string_manip.cpp
src/serialize.cpp
src/parse_args.cpp
src/guide_text.cpp
src/xen_command_tree.cpp
src/gui/accordion.cpp
src/gui/bottom_bar.cpp
src/gui/center_component.cpp
src/gui/command_bar.cpp
src/gui/directory_list_box.cpp
src/gui/library_view.cpp
src/gui/message_log.cpp
src/gui/plugin_window.cpp
src/gui/sequence_bank.cpp
src/gui/sequence.cpp
src/gui/status_bar.cpp
src/gui/themes.cpp
src/gui/tile.cpp
src/gui/tuning_reference.cpp
src/gui/xen_list_box.cpp
include/xen/actions.hpp
include/xen/double_buffer.hpp
include/xen/chord.hpp
include/xen/copy_paste.hpp
include/xen/command.hpp
include/xen/command_history.hpp
include/xen/constants.hpp
include/xen/guide_text.hpp
include/xen/input_mode.hpp
include/xen/key_core.hpp
include/xen/lock_free_optional.hpp
include/xen/lock_free_queue.hpp
include/xen/message_level.hpp
include/xen/midi.hpp
include/xen/midi_engine.hpp
include/xen/modulators.hpp
include/xen/parse_args.hpp
include/xen/selection.hpp
include/xen/serialize.hpp
include/xen/scale.hpp
include/xen/signature.hpp
include/xen/state.hpp
include/xen/string_manip.hpp
include/xen/timeline.hpp
include/xen/user_directory.hpp
include/xen/utility.hpp
include/xen/xen_command_tree.hpp
include/xen/gui/accordion.hpp
include/xen/gui/bottom_bar.hpp
include/xen/gui/command_bar.hpp
include/xen/gui/fonts.hpp
include/xen/gui/themes.hpp
include/xen/gui/directory_list_box.hpp
include/xen/gui/homogenous_row.hpp
include/xen/gui/library_view.hpp
include/xen/gui/message_log.hpp
include/xen/gui/plugin_window.hpp
include/xen/gui/sequence.hpp
include/xen/gui/sequence_bank.hpp
include/xen/gui/status_bar.hpp
include/xen/gui/tile.hpp
include/xen/gui/tuning_reference.hpp
include/xen/gui/xen_list_box.hpp
include/xen/gui/utility/dereference_iterator.hpp
)
add_executable(XenTests
# test/command.test.cpp
# test/utility.test.cpp
# test/midi.test.cpp
test/command2.test.cpp
)
target_link_libraries(XenTests
PUBLIC
XenSequencerLib
Catch2::Catch2WithMain
)
# `juce_add_plugin` adds a static library target with the name passed as the first argument
# (AudioPluginExample here). This target is a normal CMake target, but has a lot of extra properties set
# up by default. As well as this shared code static library, this function adds targets for each of
# the formats specified by the FORMATS arguments. This function accepts many optional arguments.
# Check the readme at `docs/CMake API.md` in the JUCE repo for the full list.
juce_add_plugin(XenSequencer
PRODUCT_NAME "XenSequencer" # The name of the final executable
COMPANY_NAME "A" # Specify the name of the plugin's author
IS_SYNTH TRUE # Is this a synth or an effect?
NEEDS_MIDI_INPUT TRUE # Does the plugin need midi input?
NEEDS_MIDI_OUTPUT TRUE # Does the plugin need midi output?
IS_MIDI_EFFECT FALSE # Is this plugin a MIDI effect?
EDITOR_WANTS_KEYBOARD_FOCUS TRUE # Does the editor need keyboard focus?
PLUGIN_MANUFACTURER_CODE Juce # A four-character manufacturer id with at least one upper-case character
PLUGIN_CODE Dem0 # A unique four-character plugin id with exactly one upper-case character
# GarageBand 10.3 requires the first letter to be upper-case, and the remaining letters to be lower-case
FORMATS VST3 Standalone # The formats to build. Other valid formats are: AAX Unity VST AU AUv3
)
# `juce_generate_juce_header` will create a JuceHeader.h for a given target, which will be generated
# into your build tree. This should be included with `#include <JuceHeader.h>`. The include path for
# this header will be automatically added to the target. The main function of the JuceHeader is to
# include all your JUCE module headers; if you're happy to include module headers directly, you
# probably don't need to call this.
# juce_generate_juce_header(AudioPluginExample)
# `target_compile_definitions` adds some preprocessor definitions to our target. In a Projucer
# project, these might be passed in the 'Preprocessor Definitions' field. JUCE modules also make use
# of compile definitions to switch certain features on/off, so if there's a particular feature you
# need that's not on by default, check the module header for the correct flag to set here. These
# definitions will be visible both to your code, and also the JUCE module code, so for new
# definitions, pick unique names that are unlikely to collide! This is a standard CMake command.
target_compile_definitions(XenSequencerLib
PUBLIC
# JUCE_WEB_BROWSER and JUCE_USE_CURL would be on by default, but you might not need them.
JUCE_WEB_BROWSER=0 # If you remove this, add `NEEDS_WEB_BROWSER TRUE` to the `juce_add_plugin` call
JUCE_USE_CURL=0 # If you remove this, add `NEEDS_CURL TRUE` to the `juce_add_plugin` call
JUCE_VST3_CAN_REPLACE_VST2=0
JUCE_MODAL_LOOPS_PERMITTED=1
# PRIVATE
# $<$<CONFIG:Debug>:_GLIBCXX_DEBUG>
)
target_sources(XenSequencer
PRIVATE
src/xen_editor.cpp
src/xen_processor.cpp
src/main.cpp
include/xen/xen_editor.hpp
include/xen/xen_processor.hpp
)
target_link_libraries(XenSequencer
PUBLIC
XenSequencerLib
juce::juce_audio_utils
juce::juce_recommended_config_flags
juce::juce_recommended_warning_flags
)
target_compile_options(XenSequencer INTERFACE
$<$<CXX_COMPILER_ID:MSVC>:/W1>
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Wextra -Wpedantic>
)
add_subdirectory(tools/cmd_reference)
add_subdirectory(tools/keypress)