juce_add_plugin(DrumWidener
    VERSION                     1.0.1
    PRODUCT_NAME                "Drum Widener"
    COMPANY_NAME                "e-thomsen"
    BUNDLE_ID                   "dk.e-thomsen.drumwidener"
    PLUGIN_MANUFACTURER_CODE    Etho
    PLUGIN_CODE                 Dwid
    FORMATS                     ${ET_FORMATS}
    AU_MAIN_TYPE                kAudioUnitType_Effect
    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(DrumWidener PRIVATE Source/PluginProcessor.cpp Source/PluginEditor.cpp)
et_configure_plugin(DrumWidener)

if(ET_BUILD_TESTS)
    add_executable(test_drumwidener tests/test_drumwidener.cpp)
    target_include_directories(test_drumwidener PRIVATE Source/DSP tests ${CMAKE_SOURCE_DIR}/Common/DSP)

    # the real processor and editor fed the synthetic drum loop; renders the window for screenshot.png
    juce_add_console_app(test_drumwidener_view PRODUCT_NAME "test_drumwidener_view")
    target_sources(test_drumwidener_view PRIVATE tests/render_view.cpp Source/PluginProcessor.cpp Source/PluginEditor.cpp)
    target_include_directories(test_drumwidener_view PRIVATE Source tests ${CMAKE_SOURCE_DIR}/Common ${CMAKE_SOURCE_DIR}/Common/DSP)
    target_compile_definitions(test_drumwidener_view PRIVATE JUCE_WEB_BROWSER=0 JUCE_USE_CURL=0 JUCE_MODAL_LOOPS_PERMITTED=1
                               "JucePlugin_Name=\"Drum Widener\"")
    target_link_libraries(test_drumwidener_view PRIVATE juce::juce_audio_utils et_common_assets juce::juce_dsp juce::juce_recommended_config_flags juce::juce_recommended_warning_flags)
endif()
