AAX Plugin install permissions/issue

We are currently building the AAX version of OurCoolPlugin within a VM, and constantly run into this issue:

-- Installing: /Library/Application Support/Avid/Audio/Plug-Ins/OurCoolPlugin.aaxplugin
CMake Error at /Users/builder/Desktop/Internal/OurCoolPlugin/JUCE/extras/Build/CMake/copyDir.cmake:36 (file):
  file INSTALL cannot make directory "/Library/Application
  Support/Avid/Audio/Plug-Ins/OurCoolPlugin.aaxplugin": Permission denied.

Rather than give our ‘builder’ user root permissions, I’d rather like to avoid the problem altogether, and tried to do this:

# Find the AAX SDK path if it hasn't already been set by a builder script
if (DEFINED ENV{AAX_SDK_PATH})
    message(STATUS "AAX_SDK_PATH set to: $ENV{AAX_SDK_PATH}")
    #juce_set_aax_sdk_path($ENV{AAX_SDK_PATH})
    set(AAX_PLUGIN_INSTALL_DIR "$ENV{OCP_THIS_BUILD_DIR}/Library/Application Support/Avid/Audio/Plug-Ins")
    set(FORMATS Standalone AU VST3 AUv3 AAX)
else()
    message(STATUS "AAX_SDK_PATH not set. Current hostname: ${HOSTNAME}")
    # Valid choices: AAX Unity VST VST3 AU AUv3 Standalone
    set(FORMATS Standalone AU VST3 AUv3)
endif()

… passing in “OCP_THIS_BUILD_DIR” as the “Build Directory” (with timestamp) for the build we are running - however this does not seem to work.

Is there a best-practice for getting around this issue, or am I going to be forced to set up our ‘builder’ user with root permissions, and run the scripts with sudo, as a solution?

I remember solving the same problem at some point. This used to work:

set_directory_properties( PROPERTIES JUCE_AAX_COPY_DIR  "$ENV{HOME}/Library/Application Support/Avid/Audio/Plug-Ins" )

Or you could set the AAX_COPY_DIR property per target.

Nowadays I just don’t enable the copy step at all when running release builds. That’s cleaner as it doesn’t make sense to copy results on the build machine anyway.

Nice to know someone else sorted this out … thanks for the tip, I’ll try it out.