mirror of
https://codeberg.org/armin/sm-26.git
synced 2026-10-11 17:01:53 +02:00
88 lines
2.4 KiB
Text
88 lines
2.4 KiB
Text
|
|
cmake_minimum_required(VERSION 3.22)
|
||
|
|
project(SM26 VERSION 1.0.0 LANGUAGES C CXX)
|
||
|
|
|
||
|
|
set(CMAKE_CXX_STANDARD 17)
|
||
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||
|
|
|
||
|
|
if(NOT DEFINED JUCE_ROOT)
|
||
|
|
set(JUCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/deps/juce")
|
||
|
|
endif()
|
||
|
|
|
||
|
|
if(NOT DEFINED CMAKE_BUILD_TYPE)
|
||
|
|
set(CMAKE_BUILD_TYPE Release)
|
||
|
|
endif()
|
||
|
|
|
||
|
|
if(NOT EXISTS "${JUCE_ROOT}/CMakeLists.txt")
|
||
|
|
message(FATAL_ERROR "JUCE not found at ${JUCE_ROOT}. Run 'make deps' first.")
|
||
|
|
endif()
|
||
|
|
|
||
|
|
add_subdirectory("${JUCE_ROOT}" juce_build)
|
||
|
|
|
||
|
|
if(APPLE)
|
||
|
|
set(SM26_FORMATS AU VST3)
|
||
|
|
elseif(UNIX)
|
||
|
|
set(SM26_FORMATS VST3)
|
||
|
|
else()
|
||
|
|
set(SM26_FORMATS VST3)
|
||
|
|
endif()
|
||
|
|
|
||
|
|
juce_add_plugin(SM-26
|
||
|
|
VENDOR_NAME "SM"
|
||
|
|
VENDOR_WEBSITE "https://example.org/sm-26"
|
||
|
|
VENDOR_EMAIL "dev@example.org"
|
||
|
|
VENDOR_VERSION_CODE 0x0100
|
||
|
|
PLUGIN_MANUFACTURER_CODE "SM26"
|
||
|
|
PLUGIN_CODE "SM26"
|
||
|
|
PRODUCT_NAME "SM-26"
|
||
|
|
PRODUCT_DESCRIPTION "SM-26 synthesizer"
|
||
|
|
VERSION "1.0.0"
|
||
|
|
IS_SYNTH TRUE
|
||
|
|
NEEDS_MIDI_INPUT TRUE
|
||
|
|
NEEDS_MIDI_OUTPUT FALSE
|
||
|
|
IS_MIDI_EFFECT FALSE
|
||
|
|
EDITOR_NAME "SM26AudioProcessorEditor"
|
||
|
|
EDITOR_NEEDS_KEYBOARD_FOCUS TRUE
|
||
|
|
FORMATS ${SM26_FORMATS}
|
||
|
|
)
|
||
|
|
|
||
|
|
target_sources(SM-26 PRIVATE
|
||
|
|
Source/PluginProcessor.cpp
|
||
|
|
Source/PluginEditor.cpp
|
||
|
|
Source/SynthParams.cpp
|
||
|
|
Source/SynthEngine.cpp
|
||
|
|
Source/Presets.cpp
|
||
|
|
Source/LcdDisplay.cpp
|
||
|
|
Source/MenuSystem.cpp
|
||
|
|
)
|
||
|
|
|
||
|
|
target_include_directories(SM-26 PRIVATE Source)
|
||
|
|
|
||
|
|
target_compile_definitions(SM-26 PRIVATE
|
||
|
|
JUCE_WEB_BROWSER=0
|
||
|
|
JUCE_USE_CURL=0
|
||
|
|
JUCE_ENABLE_GUI_TELNET_CONSOLE=0
|
||
|
|
JUCE_VST3_CAN_REPLACE_VST2=0
|
||
|
|
JUCE_MODAL_LOOPS_PERMITTED=1
|
||
|
|
)
|
||
|
|
|
||
|
|
juce_generate_juce_header(SM-26)
|
||
|
|
|
||
|
|
add_custom_target(gen_buildinfo ALL
|
||
|
|
COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tools/gen_buildinfo.sh"
|
||
|
|
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||
|
|
"${CMAKE_CURRENT_BINARY_DIR}/gen/BuildInfo_generated.h"
|
||
|
|
COMMENT "Generating build info header (git version + build time)"
|
||
|
|
)
|
||
|
|
add_dependencies(SM-26 gen_buildinfo)
|
||
|
|
|
||
|
|
target_include_directories(SM-26 PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/gen")
|
||
|
|
|
||
|
|
set_target_properties(SM-26 PROPERTIES OUTPUT_NAME "SM-26")
|
||
|
|
|
||
|
|
if(APPLE)
|
||
|
|
set_target_properties(SM-26 PROPERTIES
|
||
|
|
MICROPHONE_PERMISSION_ENABLED FALSE
|
||
|
|
WEBKIT_PERMISSION_ENABLED FALSE
|
||
|
|
)
|
||
|
|
endif()
|