2026-08-13 23:15:38 +02:00
|
|
|
cmake_minimum_required(VERSION 3.22)
|
|
|
|
|
project(BEAMGRID VERSION 0.1.0)
|
|
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
|
|
|
|
|
include(FetchContent)
|
|
|
|
|
FetchContent_Declare(
|
|
|
|
|
juce
|
|
|
|
|
GIT_REPOSITORY https://github.com/juce-framework/JUCE.git
|
|
|
|
|
GIT_TAG 8.0.6
|
|
|
|
|
)
|
|
|
|
|
FetchContent_MakeAvailable(juce)
|
|
|
|
|
|
|
|
|
|
juce_add_plugin(BEAMGRID
|
|
|
|
|
NAME "BEAMGRID"
|
|
|
|
|
COMPANY_NAME "Beamgrid"
|
|
|
|
|
PLUGIN_MANUFACTURER_CODE Bmgr
|
|
|
|
|
PLUGIN_CODE Bmgr
|
|
|
|
|
FORMATS VST3 AU
|
|
|
|
|
PRODUCT_NAME "BEAMGRID"
|
|
|
|
|
IS_SYNTH FALSE
|
|
|
|
|
NEEDS_MIDI_INPUT FALSE
|
|
|
|
|
NEEDS_MIDI_OUTPUT FALSE
|
|
|
|
|
IS_MIDI_EFFECT FALSE
|
|
|
|
|
EDITOR_WANTS_KEYBOARD_FOCUS FALSE
|
|
|
|
|
COPY_PLUGIN_AFTER_BUILD TRUE
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
target_sources(BEAMGRID PRIVATE
|
|
|
|
|
Source/JuceHeader.h
|
|
|
|
|
Source/Analyser.h
|
|
|
|
|
Source/Analyser.cpp
|
|
|
|
|
Source/BeamgridLookAndFeel.h
|
|
|
|
|
Source/BeamgridLookAndFeel.cpp
|
|
|
|
|
Source/AnalyserComponent.h
|
|
|
|
|
Source/AnalyserComponent.cpp
|
|
|
|
|
Source/PluginProcessor.h
|
|
|
|
|
Source/PluginProcessor.cpp
|
|
|
|
|
Source/PluginEditor.h
|
|
|
|
|
Source/PluginEditor.cpp
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
target_compile_definitions(BEAMGRID PUBLIC
|
|
|
|
|
JUCE_VST3_CAN_REPLACE_VST2=0
|
|
|
|
|
JUCE_USE_CAMERA_PERMISSIONS=0
|
2026-08-14 12:49:28 +02:00
|
|
|
# This plugin does not use a WebBrowserComponent. Disabling it avoids the
|
|
|
|
|
# GTK3 / WebKit2GTK development dependencies that juce_gui_extra pulls in
|
|
|
|
|
# on Linux (the <gtk/gtk.h> include fails to build otherwise).
|
|
|
|
|
JUCE_WEB_BROWSER=0
|
2026-08-13 23:15:38 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
target_link_libraries(BEAMGRID PRIVATE
|
|
|
|
|
juce::juce_audio_basics
|
|
|
|
|
juce::juce_audio_devices
|
|
|
|
|
juce::juce_audio_processors
|
|
|
|
|
juce::juce_audio_utils
|
|
|
|
|
juce::juce_core
|
|
|
|
|
juce::juce_data_structures
|
|
|
|
|
juce::juce_dsp
|
|
|
|
|
juce::juce_events
|
|
|
|
|
juce::juce_graphics
|
|
|
|
|
juce::juce_gui_basics
|
|
|
|
|
juce::juce_gui_extra
|
|
|
|
|
)
|
|
|
|
|
|
2026-08-14 13:28:50 +02:00
|
|
|
# This plugin does not use any networking, so disable JUCE's libcurl usage on
|
|
|
|
|
# Linux. Otherwise the build fails to link with undefined references to the
|
|
|
|
|
# curl_* symbols (see CURLSymbols in juce_core.cpp).
|
|
|
|
|
if(UNIX AND NOT APPLE)
|
|
|
|
|
target_compile_definitions(BEAMGRID PUBLIC JUCE_USE_CURL=0)
|
|
|
|
|
endif()
|
|
|
|
|
|
2026-08-13 23:15:38 +02:00
|
|
|
if(APPLE)
|
|
|
|
|
set_target_properties(BEAMGRID PROPERTIES
|
|
|
|
|
CMAKE_OSX_DEPLOYMENT_TARGET "10.15"
|
|
|
|
|
)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# Generate a version header with the current Git commit, dirty state and a
|
|
|
|
|
# fresh build timestamp. Runs on every build via a custom target.
|
|
|
|
|
set(GENERATED_DIR ${CMAKE_BINARY_DIR}/generated)
|
|
|
|
|
file(MAKE_DIRECTORY ${GENERATED_DIR})
|
|
|
|
|
set(GIT_VERSION_HEADER ${GENERATED_DIR}/GitVersion.h)
|
|
|
|
|
|
|
|
|
|
add_custom_target(generate_version ALL
|
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
|
-D SRC_DIR=${CMAKE_SOURCE_DIR}
|
|
|
|
|
-D TEMPLATE=${CMAKE_SOURCE_DIR}/Source/GitVersion.h.in
|
|
|
|
|
-D OUTPUT=${GIT_VERSION_HEADER}
|
|
|
|
|
-P ${CMAKE_SOURCE_DIR}/cmake/generate_version.cmake
|
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
|
COMMENT "Generating BEAMGRID version header"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
target_include_directories(BEAMGRID PRIVATE ${GENERATED_DIR})
|
|
|
|
|
add_dependencies(BEAMGRID generate_version)
|