-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
144 lines (121 loc) · 4.5 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
cmake_minimum_required(VERSION 3.15)
project(app-stiggi-dj VERSION 0.1.0)
option(TA_ENABLE_COVERAGE "Build with coverage enabled" OFF)
option(TA_ENABLE_ASAN "Build with address sanitizer enabled" OFF)
option(TA_ENABLE_UBSAN "Build with undefined behavior sanitizer enabled" OFF)
option(TA_ENABLE_TSAN "Build with thread sanitizer enabled" OFF)
option(TA_ENABLE_MSAN "Build with memory sanitizer enabled" OFF)
option(TA_ENABLE_WERROR "Build with warnings as errors" OFF)
# Only do these if this is the main project,
# and not if it is included through add_subdirectory.
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
# Caches build artifacts for faster builds
find_program(CCACHE ccache)
if (CCACHE)
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE})
endif ()
# Set C11 with no extensions enabled. Fail if the
# standard is not supported.
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)
# Set C++14 with no extensions enabled. Fail if the
# standard is not supported.
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# library settings
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(BUILD_SHARED_LIBS OFF)
# misc
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Minimum macOS version
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11")
endif ()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(CompilerOptions)
include(CompilerWarnings)
include(CodeCoverage)
add_library(ta_rubberband)
add_library(ta::rubberband ALIAS ta_rubberband)
target_sources(ta_rubberband PRIVATE 3rd_party/rubberband/single/RubberBandSingle.cpp)
target_compile_definitions(ta_rubberband PUBLIC NOMINMAX=1 WIN32_LEAN_AND_MEAN=1)
target_include_directories(ta_rubberband PUBLIC 3rd_party/rubberband)
add_subdirectory(3rd_party/JUCE)
set_directory_properties(PROPERTIES JUCE_COMPANY_COPYRIGHT "SPDX: GPL-3.0-only")
set_directory_properties(PROPERTIES JUCE_COMPANY_NAME "tobantAudio")
set_directory_properties(PROPERTIES JUCE_COMPANY_WEBSITE "https://github.com/tobanteAudio/StiggiDJ")
set_directory_properties(PROPERTIES JUCE_COMPANY_EMAIL "[email protected]")
juce_add_binary_data(StiggiDJ_BinaryData
HEADER_NAME
"BinaryData.hpp"
NAMESPACE
tabd
SOURCES
"Makefile"
)
juce_add_gui_app(StiggiDJ
PRODUCT_NAME "Stiggi DJ"
BUNDLE_ID "com.tobanteAudio.stiggi-dj"
VERSION ${CMAKE_PROJECT_VERSION}
HARDENED_RUNTIME_ENABLED TRUE
)
target_sources(StiggiDJ
PRIVATE
"src/Main.cpp"
"src/MainComponent.hpp"
"src/MainComponent.cpp"
"src/Core/Array.hpp"
"src/DSP/BeatTrack.cpp"
"src/DSP/BeatTrack.hpp"
"src/DSP/DJPlayer.cpp"
"src/DSP/DJPlayer.hpp"
"src/UI/Component/JogWheel.cpp"
"src/UI/Component/JogWheel.hpp"
"src/UI/Component/Placeholder.cpp"
"src/UI/Component/Placeholder.hpp"
"src/UI/Component/WaveformDisplay.cpp"
"src/UI/Component/WaveformDisplay.hpp"
"src/UI/Section/Display.cpp"
"src/UI/Section/Display.hpp"
"src/UI/Section/MainSection.cpp"
"src/UI/Section/MainSection.hpp"
"src/UI/Section/SideBarLeft.cpp"
"src/UI/Section/SideBarLeft.hpp"
"src/UI/Section/SideBarRight.cpp"
"src/UI/Section/SideBarRight.hpp"
)
target_compile_definitions(StiggiDJ
PRIVATE
JUCE_APPLICATION_NAME_STRING="$<TARGET_PROPERTY:StiggiDJ,JUCE_PRODUCT_NAME>"
JUCE_APPLICATION_VERSION_STRING="$<TARGET_PROPERTY:StiggiDJ,JUCE_VERSION>"
JUCE_USE_MP3AUDIOFORMAT=1
JUCE_DISPLAY_SPLASH_SCREEN=0
JUCE_MODAL_LOOPS_PERMITTED=1
JUCE_REPORT_APP_USAGE=0
DONT_SET_USING_JUCE_NAMESPACE=1
JUCE_USE_CURL=0
JUCE_WEB_BROWSER=0
)
target_include_directories(StiggiDJ
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
)
target_link_libraries(StiggiDJ
PRIVATE
StiggiDJ_BinaryData
juce::juce_gui_extra
juce::juce_audio_basics
juce::juce_audio_devices
juce::juce_audio_formats
juce::juce_audio_utils
juce::juce_recommended_config_flags
juce::juce_recommended_lto_flags
juce::juce_recommended_warning_flags
ta::rubberband
ta::compiler_options
ta::compiler_warnings
ta::coverage
)