AUv3: Customize Bundle ID

Unless I’m missing something, I think this can be achieved without forking JUCE. I can successfully archive the AudioPluginExample with two inner AUv3s after building it like this:

juce_add_plugin(AudioPluginExample
    FORMATS Standalone AUv3
    PLUGIN_CODE m1n3
    BUNDLE_ID "com.reuk.mycoolplugin"
    PRODUCT_NAME "StandaloneAndAUv3")

set(auv3_identifier "com.reuk.mycoolplugin.justAUv3")

juce_add_plugin(AudioPluginExampleTwo
    FORMATS AUv3
    PLUGIN_CODE m1n1
    PRODUCT_NAME "JustAUv3"
    PLIST_TO_MERGE "<plist><dict>
        <key>CFBundleIdentifier</key>
        <string>${auv3_identifier}</string>
    </dict></plist>")

add_dependencies(AudioPluginExample_Standalone AudioPluginExampleTwo_AUv3)

set_target_properties(AudioPluginExampleTwo AudioPluginExampleTwo_AUv3
    PROPERTIES XCODE_ATTRIBUTE_SKIP_INSTALL "YES")

set_target_properties(AudioPluginExampleTwo_AUv3
    PROPERTIES XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${auv3_identifier}")

copy_full_dir(AudioPluginExample_Standalone
    "$<TARGET_BUNDLE_DIR:AudioPluginExampleTwo_AUv3>"
    "$<TARGET_BUNDLE_CONTENT_DIR:AudioPluginExample_Standalone>/PlugIns")
3 Likes