Skip to content

Commit bb6600a

Browse files
committed
refactor: Update CMake configuration
1 parent 01c4508 commit bb6600a

3 files changed

Lines changed: 49 additions & 43 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
#==============================================================================
44

55
cmake_minimum_required(VERSION 3.30)
6-
project(Oscilloscope VERSION 1.0.0) # Oscilloscope-Version
6+
file(READ "${CMAKE_CURRENT_LIST_DIR}/VERSION.md" FILE_VERSION)
7+
string(STRIP "${FILE_VERSION}" FILE_VERSION)
8+
project(Oscilloscope VERSION ${FILE_VERSION})
79
set(CMAKE_CXX_STANDARD 23)
810
set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS TRUE)
911
set(EXT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external)
12+
13+
# Set macOS deployment target for older macOS compatibility
1014
include(cmake/get_cpm.cmake)
1115

1216
# Add external dependencies
@@ -16,12 +20,6 @@ CPMAddPackage(
1620
GIT_TAG master
1721
SOURCE_DIR ${EXT_DIR}/juce
1822
)
19-
CPMAddPackage(
20-
NAME DMT
21-
GITHUB_REPOSITORY Dimethoxy/DMT
22-
GIT_TAG main
23-
SOURCE_DIR ${EXT_DIR}/dmt
24-
)
2523
CPMAddPackage(
2624
NAME CLAP_JUCE
2725
GITHUB_REPOSITORY free-audio/clap-juce-extensions
@@ -52,3 +50,4 @@ endif()
5250
add_definitions(-D_SILENCE_CXX23_ALIGNED_STORAGE_DEPRECATION_WARNING)
5351

5452
add_subdirectory(src)
53+

external/dmt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/CMakeLists.txt

Lines changed: 43 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,38 @@
33
#==============================================================================
44

55
cmake_minimum_required(VERSION 3.22)
6-
project(OscilloscopePlugin VERSION 1.0.0) # Oscilloscope-Version
6+
if(NOT DEFINED FILE_VERSION)
7+
file(READ "${CMAKE_CURRENT_LIST_DIR}/../VERSION.md" FILE_VERSION)
8+
string(STRIP "${FILE_VERSION}" FILE_VERSION)
9+
endif()
10+
project(OscilloscopePlugin VERSION ${FILE_VERSION})
711

812
# If we are on MacOS, we need to build for arm64 and x86_64
913
if (APPLE)
1014
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
15+
# Apparently macOS 12.0 is the minimum for reliable C++23 support
16+
# But we yolo it and just hope for the best on older macOS versions
17+
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13")
1118
endif()
1219

1320
# Option to disable update notification (default OFF)
1421
option(DMT_DISABLE_UPDATE_NOTIFICATION "Disable update notification in the GUI" OFF)
1522

1623
# JUCE setup
1724
if(WIN32)
18-
set(OSCILLOSCOPE_PLUGIN_FORMATS "VST3;CLAP;Standalone")
25+
set(OS_PLUGIN_FORMATS "VST3;CLAP;Standalone")
1926
elseif(APPLE)
20-
set(OSCILLOSCOPE_PLUGIN_FORMATS "VST3;CLAP;AU;Standalone")
27+
set(OS_PLUGIN_FORMATS "VST3;CLAP;AU;Standalone")
2128
elseif(UNIX)
22-
set(OSCILLOSCOPE_PLUGIN_FORMATS "VST3;CLAP;LV2;Standalone")
29+
set(OS_PLUGIN_FORMATS "VST3;CLAP;LV2;Standalone")
2330
else()
24-
set(OSCILLOSCOPE_PLUGIN_FORMATS "VST3;CLAP;Standalone")
31+
set(OS_PLUGIN_FORMATS "VST3;CLAP;Standalone")
2532
endif()
2633

2734
juce_add_plugin(${PROJECT_NAME}
2835
PRODUCT_NAME "Oscilloscope"
2936
COMPANY_NAME "Dimethoxy"
30-
FORMATS ${OSCILLOSCOPE_PLUGIN_FORMATS}
37+
FORMATS ${OS_PLUGIN_FORMATS}
3138
VST3_CATEGORIES "Fx" "Analyzer"
3239
IS_SYNTH FALSE
3340
NEEDS_MIDI_INPUT FALSE
@@ -38,7 +45,7 @@ juce_add_plugin(${PROJECT_NAME}
3845
PLUGIN_CODE DFLX
3946
LV2URI "https://dimethoxy.com/plugins/oscilloscope"
4047
BUNDLE_ID com.dimethoxy.oscilloscope
41-
)
48+
)
4249

4350
# Add the main source files
4451
target_sources(${PROJECT_NAME}
@@ -50,40 +57,41 @@ target_sources(${PROJECT_NAME}
5057
# Add the external libraries
5158
target_include_directories(${PROJECT_NAME}
5259
PUBLIC
53-
${CMAKE_SOURCE_DIR}/external/dmt
60+
${CMAKE_SOURCE_DIR}/src
61+
${CMAKE_SOURCE_DIR}/src/dmt
5462
${CMAKE_SOURCE_DIR}/external/melatonin_perfetto
5563
${CMAKE_SOURCE_DIR}/external/tomlplusplus
5664
)
5765

5866
# Add fonts and icons as binary data so they can be used in the app
5967
juce_add_binary_data(FontBinaryData
6068
SOURCES
61-
${CMAKE_SOURCE_DIR}/external/dmt/fonts/poppins/Poppins-Thin.ttf
62-
${CMAKE_SOURCE_DIR}/external/dmt/fonts/poppins/Poppins-ExtraLight.ttf
63-
${CMAKE_SOURCE_DIR}/external/dmt/fonts/poppins/Poppins-Light.ttf
64-
${CMAKE_SOURCE_DIR}/external/dmt/fonts/poppins/Poppins-Regular.ttf
65-
${CMAKE_SOURCE_DIR}/external/dmt/fonts/poppins/Poppins-Medium.ttf
66-
${CMAKE_SOURCE_DIR}/external/dmt/fonts/poppins/Poppins-SemiBold.ttf
67-
${CMAKE_SOURCE_DIR}/external/dmt/fonts/poppins/Poppins-Bold.ttf
68-
${CMAKE_SOURCE_DIR}/external/dmt/fonts/poppins/Poppins-ExtraBold.ttf
69-
${CMAKE_SOURCE_DIR}/external/dmt/fonts/poppins/Poppins-Black.ttf
70-
${CMAKE_SOURCE_DIR}/external/dmt/fonts/sedgwick_ave_display/SedgwickAveDisplay-Regular.ttf
71-
${CMAKE_SOURCE_DIR}/external/dmt/icons/speed.svg
72-
${CMAKE_SOURCE_DIR}/external/dmt/icons/back.svg
73-
${CMAKE_SOURCE_DIR}/external/dmt/icons/height.svg
74-
${CMAKE_SOURCE_DIR}/external/dmt/icons/thickness.svg
75-
${CMAKE_SOURCE_DIR}/external/dmt/icons/gear.svg
76-
${CMAKE_SOURCE_DIR}/external/dmt/icons/angles_up.svg
77-
${CMAKE_SOURCE_DIR}/external/dmt/icons/bypass.svg
78-
${CMAKE_SOURCE_DIR}/external/dmt/icons/download.svg
79-
${CMAKE_SOURCE_DIR}/external/dmt/icons/presets.svg
80-
${CMAKE_SOURCE_DIR}/external/dmt/icons/close.svg
81-
${CMAKE_SOURCE_DIR}/external/dmt/icons/reload.svg
82-
${CMAKE_SOURCE_DIR}/external/dmt/icons/save.svg
83-
${CMAKE_SOURCE_DIR}/external/dmt/icons/error.svg
84-
${CMAKE_SOURCE_DIR}/external/dmt/icons/warning.svg
85-
${CMAKE_SOURCE_DIR}/external/dmt/icons/success.svg
86-
${CMAKE_SOURCE_DIR}/external/dmt/icons/info.svg
69+
${CMAKE_SOURCE_DIR}/src/dmt/fonts/poppins/Poppins-Thin.ttf
70+
${CMAKE_SOURCE_DIR}/src/dmt/fonts/poppins/Poppins-ExtraLight.ttf
71+
${CMAKE_SOURCE_DIR}/src/dmt/fonts/poppins/Poppins-Light.ttf
72+
${CMAKE_SOURCE_DIR}/src/dmt/fonts/poppins/Poppins-Regular.ttf
73+
${CMAKE_SOURCE_DIR}/src/dmt/fonts/poppins/Poppins-Medium.ttf
74+
${CMAKE_SOURCE_DIR}/src/dmt/fonts/poppins/Poppins-SemiBold.ttf
75+
${CMAKE_SOURCE_DIR}/src/dmt/fonts/poppins/Poppins-Bold.ttf
76+
${CMAKE_SOURCE_DIR}/src/dmt/fonts/poppins/Poppins-ExtraBold.ttf
77+
${CMAKE_SOURCE_DIR}/src/dmt/fonts/poppins/Poppins-Black.ttf
78+
${CMAKE_SOURCE_DIR}/src/dmt/fonts/sedgwick_ave_display/SedgwickAveDisplay-Regular.ttf
79+
${CMAKE_SOURCE_DIR}/src/dmt/icons/speed.svg
80+
${CMAKE_SOURCE_DIR}/src/dmt/icons/back.svg
81+
${CMAKE_SOURCE_DIR}/src/dmt/icons/height.svg
82+
${CMAKE_SOURCE_DIR}/src/dmt/icons/thickness.svg
83+
${CMAKE_SOURCE_DIR}/src/dmt/icons/gear.svg
84+
${CMAKE_SOURCE_DIR}/src/dmt/icons/angles_up.svg
85+
${CMAKE_SOURCE_DIR}/src/dmt/icons/bypass.svg
86+
${CMAKE_SOURCE_DIR}/src/dmt/icons/download.svg
87+
${CMAKE_SOURCE_DIR}/src/dmt/icons/presets.svg
88+
${CMAKE_SOURCE_DIR}/src/dmt/icons/close.svg
89+
${CMAKE_SOURCE_DIR}/src/dmt/icons/reload.svg
90+
${CMAKE_SOURCE_DIR}/src/dmt/icons/save.svg
91+
${CMAKE_SOURCE_DIR}/src/dmt/icons/error.svg
92+
${CMAKE_SOURCE_DIR}/src/dmt/icons/warning.svg
93+
${CMAKE_SOURCE_DIR}/src/dmt/icons/success.svg
94+
${CMAKE_SOURCE_DIR}/src/dmt/icons/info.svg
8795
)
8896

8997
# Link the libraries
@@ -141,7 +149,7 @@ message("JUCE header file generated!")
141149
if(MSVC)
142150
target_compile_definitions(${PROJECT_NAME}
143151
PRIVATE
144-
_SILENCE_CXX23_ALIGEND_STORAGE_DEPRECATION_WARNING
152+
_SILENCE_CXX23_ALIGNED_STORAGE_DEPRECATION_WARNING
145153
)
146154
endif()
147155

0 commit comments

Comments
 (0)