COPY_PLUGIN_AFTER_BUILD per plugin format?

Building AAX in a CI environment with COPY_PLUGIN_AFTER_BUILD set to TRUE results in an error:

file cannot create directory: /Library/Application/Support/Avid/Audio/Plug-Ins

Since I don’t necessarily need to copy the plugin to that location in my CI environment i disabled COPY_PLUGIN_AFTER_BUILD.

However this causes a problem when validating the AU format with Pluginval. When using Pluginval to validate an AU, the AU must be copied to the correct location: /Library/Audio/Plug-Ins/Components. Otherwise Pluginval can’t find the AU (see https://github.com/Tracktion/pluginval/issues/122).

So ideally i would like to set COPY_PLUGIN_AFTER_BUILD to TRUE for the AU format but not for the AAX format. Is there a nice way to do this with the JUCE CMake API? Or would i have to create a custom command?

Tried something like this?


# Add AAX-specific options or definitions
if(JUCE_BUILD_AAX)
    message(STATUS "AAX Build: will not copy plugin after build")
    set(JUCE_COPY_PLUGIN_AFTER_BUILD FALSE)
endif()

# Add AU-specific options or definitions
if(JUCE_BUILD_AU)
    message(STATUS "AU Build: will copy plugin into plugins directory after build")
    set(JUCE_COPY_PLUGIN_AFTER_BUILD TRUE)
endif()

Thanks for your help.

This would be a nice way but i think JUCE_BUILD_AAX and JUCE_BUILD_AU are not valid properties (correct me if i am wrong).

Also, the JUCE_COPY_PLUGIN_AFTER_BUILD will call juce_enable_copy_plugin_step which always copies all active plugin formats.

Oh sorry, that was just some pseudo-code, I guess another way to do this is within juce_add_plugin with something like:

    COPY_PLUGIN_AFTER_BUILD "$<$<NOT:$<BOOL:$<OR:$<TARGET_PROPERTY:JUCE_PLUGIN_AAX>,$<TARGET_PROPERTY:JUCE_PLUGIN_RTAS>>>>:ON>"

I’ll try this out myself on the next build - I also want to do something similar, FWIW. At the moment I just disable the copy globally for Release builds but enable it globally for Debug - I get past the permission problems for example, with the AAX builds, by forcefully rm -rf’ing the ‘/Library/Application Support/Avid/Audio/Plug-Ins/’ folder in the build-script before kicking off CMake, but this is … unsavoury … since it requires root permissions - which, okay, is being done within a CI VM anyway, but still feels gross.

While this exact feature isn’t provided out-of-the-box, you could consider setting AAX_COPY_DIR to specify a different, writable location for installed AAX plugins.

Thanks! This seems to be a good workaround.