# Plugin target. # Plugin metadata. It lives here once because juce_add_plugin and the cross-build # VST3 manifest in cmake/moduleinfo.json.in both need the same values. set(SERUMALT_COMPANY_NAME "SerumAlt Audio") set(SERUMALT_MANUFACTURER_CODE Salt) set(SERUMALT_PLUGIN_CODE Sera) set(SERUMALT_VST3_SDK_VERSION "VST 3.7.8") # ships with the vendored JUCE 7.0.12 # VST3 class IDs. Each is a fixed prefix, a per-class constant and the # manufacturer and plugin codes as ASCII hex, built the same way JUCE builds # them in juce_audio_plugin_client_VST3.cpp. string(HEX "${SERUMALT_MANUFACTURER_CODE}${SERUMALT_PLUGIN_CODE}" serumaltCodeHex) string(TOUPPER "${serumaltCodeHex}" serumaltCodeHex) set(SERUMALT_CID_AUDIO_MODULE "ABCDEF019182FAEB${serumaltCodeHex}") set(SERUMALT_CID_CONTROLLER "ABCDEF011234ABCD${serumaltCodeHex}") set(SERUMALT_CID_COMPATIBILITY "ABCDEF01C0DEF00D${serumaltCodeHex}") # JUCE builds its VST3 manifest helper with the target toolchain, so during a # Windows cross-build that helper is a Windows .exe and cannot run on the Linux # host. Disable the automatic step and write the manifest from the template # instead. Native builds keep JUCE's automatic step. set(SERUMALT_VST3_AUTO_MANIFEST TRUE) if(CMAKE_CROSSCOMPILING) set(SERUMALT_VST3_AUTO_MANIFEST FALSE) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake/moduleinfo.json.in" "${CMAKE_BINARY_DIR}/moduleinfo.json" @ONLY) endif() set(SERUMALT_FORMATS VST3) if(NOT WIN32) list(APPEND SERUMALT_FORMATS Standalone) endif() if(APPLE) list(APPEND SERUMALT_FORMATS AU) endif() juce_add_plugin(SerumAlt VERSION ${PROJECT_VERSION} COMPANY_NAME "${SERUMALT_COMPANY_NAME}" IS_SYNTH TRUE NEEDS_MIDI_INPUT TRUE NEEDS_MIDI_OUTPUT FALSE IS_MIDI_EFFECT FALSE EDITOR_WANTS_KEYBOARD_FOCUS FALSE PLUGIN_MANUFACTURER_CODE ${SERUMALT_MANUFACTURER_CODE} PLUGIN_CODE ${SERUMALT_PLUGIN_CODE} BUNDLE_ID com.serumalt.SerumAlt FORMATS ${SERUMALT_FORMATS} PRODUCT_NAME "SerumAlt" VST3_AUTO_MANIFEST ${SERUMALT_VST3_AUTO_MANIFEST}) serumalt_configure_target(SerumAlt) # A MinGW cross-build must link libgcc, libstdc++ and winpthread statically. # A stock Windows host has none of those DLLs, so a dynamic link produces a # module that fails to load and disappears from the host's plugin list. if(MINGW) target_link_options(SerumAlt_VST3 PRIVATE -static-libgcc -static-libstdc++ -static) endif()