Multi-target project exporters

This is what I’ve worked out so far. I have the following saved in a xxx.bat file:

rem %1 is $(ProjectName)
rem %2 is $(OutDir)$(TargetFileName)
set projectname=%1
set binaryfile=%2

echo %projectname%|findstr /C:"(VST)" >nul 2>&1
IF %errorlevel% EQU 0 (
  echo "Do something with VST"
)

echo %projectname%|findstr /C:"(VST3)" >nul 2>&1
IF %errorlevel% EQU 0 (
  echo "Do something with VST3"
)

echo %projectname%|findstr /C:"(AAX)" >nul 2>&1
IF %errorlevel% EQU 0 (
  echo "Do something with AAX"
)

verify >nul

Then in the Post-build Command field in the Projucer, I have this:
call "path\to\xxx.bat" "$(ProjectName)" "$(OutDir)$(TargetFileName)"

(EDITED: to use verify >nul to reset %errorlevel% since exit 0 prevents any subsequent post-build events from running, which essentially breaks AAX builds!)

2 Likes