Split CMakeLists.txt into cmake/Plugin.cmake (production formats and MinGW link flags) and cmake/Harness.cmake (console test harness with CTest registration). Add SERUMALT_BUILD_PLUGIN and SERUMALT_BUILD_TESTS options so production and harness builds are mutually exclusive and each omits the other's targets. Add build_linux.sh, build_macos.sh, and build_harness.sh with host validation, env-overridable build dirs, and explicit option flags. Rewrite build_windows.sh to use the checked-in mingw64-toolchain.cmake instead of regenerating it, validate all required tools, and stage with cmake -E copy_directory. Broaden .gitignore to cover all build_*/ directories.
96 lines
2.9 KiB
CMake
96 lines
2.9 KiB
CMake
cmake_minimum_required(VERSION 3.22)
|
|
|
|
project(SerumAlt VERSION 1.0.0 LANGUAGES CXX)
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# C++ standard
|
|
# ---------------------------------------------------------------------------
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
option(SERUMALT_BUILD_PLUGIN "Build production plugin and standalone formats" ON)
|
|
option(SERUMALT_BUILD_TESTS "Build the headless QA harness" OFF)
|
|
|
|
if(NOT SERUMALT_BUILD_PLUGIN AND NOT SERUMALT_BUILD_TESTS)
|
|
message(FATAL_ERROR "Enable SERUMALT_BUILD_PLUGIN or SERUMALT_BUILD_TESTS")
|
|
endif()
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# JUCE
|
|
# ---------------------------------------------------------------------------
|
|
if(NOT DEFINED JUCE_ROOT)
|
|
set(JUCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/third_party/JUCE")
|
|
endif()
|
|
add_subdirectory("${JUCE_ROOT}" "${CMAKE_CURRENT_BINARY_DIR}/third_party/JUCE")
|
|
|
|
set(SERUMALT_SOURCES
|
|
Source/PluginProcessor.cpp
|
|
Source/PluginEditor.cpp
|
|
Source/Params.cpp
|
|
Source/Wavetable.cpp
|
|
Source/Oscillator.cpp
|
|
Source/SubOscillator.cpp
|
|
Source/NoiseOscillator.cpp
|
|
Source/Filter.cpp
|
|
Source/FilterBank.cpp
|
|
Source/Envelope.cpp
|
|
Source/LFO.cpp
|
|
Source/ModulationMatrix.cpp
|
|
Source/FXProcessor.cpp
|
|
Source/MacroControls.cpp
|
|
Source/RAVEButton.cpp
|
|
Source/SynthVoice.cpp
|
|
Source/Engine.cpp
|
|
Source/Resources.cpp
|
|
Source/EffectUnits/Hyper.cpp
|
|
Source/EffectUnits/Chorus.cpp
|
|
Source/EffectUnits/Flanger.cpp
|
|
Source/EffectUnits/Phaser.cpp
|
|
Source/EffectUnits/Distortion.cpp
|
|
Source/EffectUnits/EQ.cpp
|
|
Source/EffectUnits/Compressor.cpp
|
|
Source/EffectUnits/Delay.cpp
|
|
Source/EffectUnits/Reverb.cpp
|
|
Source/GUI/Knob.cpp
|
|
Source/GUI/Slider.cpp
|
|
Source/GUI/ToggleButton.cpp
|
|
Source/GUI/Display.cpp
|
|
Source/GUI/WaveformDisplay.cpp
|
|
Source/GUI/FilterDisplay.cpp
|
|
Source/GUI/EnvelopeDisplay.cpp
|
|
Source/GUI/LFODisplay.cpp
|
|
Source/GUI/Panel.cpp
|
|
Source/Presets/FactoryPresets.cpp)
|
|
|
|
function(serumalt_configure_target target)
|
|
juce_generate_juce_header(${target})
|
|
target_sources(${target} PRIVATE ${SERUMALT_SOURCES})
|
|
target_compile_definitions(${target}
|
|
PUBLIC
|
|
JUCE_WEB_BROWSER=0
|
|
JUCE_USE_CURL=0
|
|
JUCE_VST3_CAN_REPLACE_VST2=0)
|
|
target_link_libraries(${target}
|
|
PRIVATE
|
|
juce::juce_audio_utils
|
|
juce::juce_dsp
|
|
PUBLIC
|
|
juce::juce_recommended_config_flags
|
|
juce::juce_recommended_warning_flags)
|
|
if(MSVC)
|
|
target_compile_options(${target} PRIVATE /W4)
|
|
else()
|
|
target_compile_options(${target} PRIVATE -Wall -Wextra)
|
|
endif()
|
|
endfunction()
|
|
|
|
if(SERUMALT_BUILD_PLUGIN)
|
|
include(cmake/Plugin.cmake)
|
|
endif()
|
|
|
|
if(SERUMALT_BUILD_TESTS)
|
|
enable_testing()
|
|
include(cmake/Harness.cmake)
|
|
endif()
|