I am on Windows 10 and Unreal 4.15.
When I right click a Unreal project to generate Visual Studio solution files, there isn't any option to change the output directory, and it always goes to the same folder as the project file, which means the source files and the build files are mixed together.
For traditional C++ projects where the build files are generated by CMake, we can do something like:
mkdir build
cd build
cmake -A x64 ..
msbuild test.sln
The build files and source files are separated. Is it possible to do this kind of good practice for Unreal projects?
Below is the command line I am currently using to generate the build files for Unreal:
UnrealBuildTool.exe -projectfiles -project="%WORKSPACE%/projectname/projectname.uproject" -game -rocket -progress
They are not mixed together completely. As far as I know, Unreal Engine projects requires an exactly defined folder structure (Unreal Engine documentation).
So your C++ source code is in folder Source, but generated files for Visual Studio or equivalent tool are in folder Intermediate. So these files are usually not versioned by Git or other versioning tools. (GitHub has a nice predefined .gitignore file for Unreal Engine GitHub Unreal Engine .gitignore).
In conclusion - no, it is not possible and in my opinion it would be also contraproductive - currently it works perfectly even for big projects with multiple gameplay modules (they are actually DLL files Gameplay Modules documentation).