How to move Blender without breaking CMake and MS Visual Studio?

Let’s say I have followed Building Blender/Windows - Blender Developer Wiki and built Blender in C:\blender-git. But then I notice that I don’t have enough space on the C: Disk anymore so I move the blender-git folder to the D: Disk. Th final path to my Blender source folder would then be D:\blender-git. When I try to run remake.bat or Local Windows Debugger in MS Visual Studio in my Blender build it gives errors about not finding C:\blender-git, which of course it can’t because I moved the folder to D:\blender-git.

How can I move C:\blender-git in a way that makes sure that CMake and MS Visual Studio will continue to work?

You can’t really move a CMake build dir because of the absolute paths. By far the easiest solution is just to delete the build dir and setup a new build dir from the new location.

Takes you one full rebuild of time. Which is probably less than hunting down all C:\s and changing them to D;\s and forgetting a few and cursing Cmake ;-D

2 Likes

There is another choice to edit the vcxproj files etc and do regex replace the fullpaths.

Probably or possibly things would work fine, I have generated my own vcxproj files from time to time for small projects.

However since Blender is very complex project with thousands of files not exacly a guarranteed solution if everything works 100% perfectly.

Manually editing won’t work, as soon as cmake needs to run it will either error out because of the new location or undo all your handywork. @Baardaap is on the right path, just remove your build folder, and start over. it’s the only way.

Does it work if you make a symlink at C:\blender-git pointing to D:\blender-git ?