I would like to configure UE to build its various targets - Game, Client, Editor, and Server - in different subdirectories under `Binaries\Win64`, rather than them all going into the same directory.
The main reason I would like to do this is because our process requires other files to be copied in alongside the binaries, and these can have conflicting requirements. For example, Steam has a `steam_appid.txt` file which needs to exist in that directory for dedicated server builds, but which non-shipping client executables will delete when the process ends, causing interesting race conditions depending on which process was built most recently versus which one was executed most recently.
I found that `TargetRules` has the `ExeBinariesSubFolder` property, which appears to be exactly what I need. However, it is affected by the `[RequiresUniqueBuildEnvironment]` attribute, and it’s not entirely clear what this means as I’m not sure exactly what has a ‘Shared’ environment and what has a ‘Unique’ one.
When I want a server build, I can set this `ExeBinariesSubFolder` value in the relevant target.cs to ‘Server’ and it correctly drops all the files into that Server subdirectory, with a .target metadata file in the main Win64 directory - all good. I’m assuming this target has a Unique environment by default.
Similarly, when I want a client build, I set the value to ‘Client’ , and everything goes into Client except the accompanying .target file, which is what I want.
But when I create an editor build, it complains that our program’s editor project shares an environment with UnrealEditor.
`YourGameEditor modifies the values of properties: [ ExeBinariesSubFolder: Editor != ]. This is not allowed, as YourGameEditor has build products in common with UnrealEditor.`
So, I set `BuildEnvironment = TargetBuildEnvironment.Unique` in the target to try and resolve this, and this has unexpected results: while it does produce the ‘Editor’ subdirectory as I expect, it also drops hundreds of .dlls and .pdbs into the Win64 directory, plus it creates empty subdirectories for all the platforms I am not building - Android, GDK, iOS, Linux, etc. This is inside `Binaries\Win64` so it’s clearly not right.
Is it possible to do what I want, including an Editor target configuration, and having each target completely restricted to its own subdirectory?