Visual Studio Post Build Commands hassle



I found that upon project save the projucer erases the target specific post build commands that I have defined in Visual studio.
On the other hand it seems like the debug command settings remain untouched.
Since post build commands are a) often different for each plugin format and b) almost always platform specific: Wouldn’t it be nice if we could make these settings in the IDE without interference from Projucer ?
(as it obviously is already the case with the debug commands)


Why not just add the commands to the Projucer project?


Because they are specific to the plugin format.
Here is My VST2 post build event:

move $(TargetPath) C:\plugins\Vst2$(Platform)\

The other plugin Formats need to be moved/copied to different folders (or to none at all)
In the past I also had automated stopping and restarting the test host through these events. This is of course plugin format specific as well.


If Projucer were to write those settings to a separate Property Sheet for Visual Studio (or xcconfig file for Mac) rather than rebuilding the whole IDE project from scratch, it would be easy to have an IDE project that takes the majority of its settings from those Property Sheets but that can also non-destructively override some of them where needed.


I have been able to workaround this by calling a batch file in my post build command with VS environment variables. For example, my Projucer post build step looks like this:

.\copyplugs.bat $(ProjectName) $(Configuration) $(Platform) "$(TargetPath)"

In my copyplugs.bat, the $ProjectName lets me know which project (MyPlugin_VST, etc), and the other variables are there if I want to know where VS put my build, which architecture is being built, etc… since 32 bit plugs and 64 bit plugs go into different directories on my machine