-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
95 lines (80 loc) · 2.7 KB
/
CMakeLists.txt
File metadata and controls
95 lines (80 loc) · 2.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
cmake_minimum_required(VERSION 3.24)
# Change to your project name
project(JuceFirstSound VERSION 0.0.1)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_XCODE_GENERATE_SCHEME ON)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# We're going to use CPM as our package manager to bring in JUCE
# Check to see if we have CPM installed already. Bring it in if we don't.
set(CPM_DOWNLOAD_VERSION 0.34.0)
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
if (NOT EXISTS ${CPM_DOWNLOAD_LOCATION})
message(STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}")
file(DOWNLOAD https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake ${CPM_DOWNLOAD_LOCATION})
endif ()
include(${CPM_DOWNLOAD_LOCATION})
# Bring in JUCE locally
CPMAddPackage(
NAME juce
GIT_REPOSITORY https://github.com/juce-framework/JUCE.git
GIT_TAG origin/master
)
# Make sure you include any new source files here
set(SourceFiles
Source/PluginEditor.cpp
Source/PluginEditor.h
Source/PluginProcessor.cpp
Source/PluginProcessor.h
Source/SineWave.cpp
Source/SineWave.h
Source/SineWaveChannel.cpp
Source/SineWaveChannel.h
)
# Change these to your own preferences
juce_add_plugin(${PROJECT_NAME}
COMPANY_NAME The Audio Programmer
IS_SYNTH FALSE
NEEDS_MIDI_INPUT FALSE
NEEDS_MIDI_OUTPUT FALSE
IS_MIDI_EFFECT FALSE
EDITOR_WANTS_KEYBOARD_FOCUS FALSE
JUCE_VST3_CAN_REPLACE_VST2 FALSE
COPY_PLUGIN_AFTER_BUILD TRUE
PLUGIN_MANUFACTURER_CODE Tap1
PLUGIN_CODE Reg0
FORMATS VST3 AU Standalone
PRODUCT_NAME "JuceFirstSound"
)
juce_add_binary_data(BinaryData
SOURCES
Assets/tap_logo.png
)
# How we want our SourceFiles to appear in our IDE
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SourceFiles})
# Make the SourceFiles buildable
target_sources(${PROJECT_NAME} PRIVATE ${SourceFiles})
# These are some toggleable options from the JUCE CMake API
target_compile_definitions(${PROJECT_NAME}
PUBLIC
JUCE_WEB_BROWSER=0
JUCE_USE_CURL=0
JUCE_VST3_CAN_REPLACE_VST2=0
)
# JUCE libraries to bring into our project
target_link_libraries(${PROJECT_NAME}
PUBLIC
juce::juce_analytics
juce::juce_audio_basics
juce::juce_audio_devices
juce::juce_core
juce::juce_data_structures
juce::juce_graphics
juce::juce_gui_basics
juce::juce_gui_extra
juce::juce_audio_utils
juce::juce_dsp
juce::juce_recommended_config_flags
juce::juce_recommended_lto_flags
juce::juce_recommended_warning_flags
BinaryData
)