Visual Studio project build outside of source directory

Hi, I am a newbie to blender development and I’m having a hard time working with the Visual Studio solution created by cmake.
Although this is not directly about building from source, it is regarding how one would go about working with the source code after a successful build. Couple of problems here:

  1. Unlike VS code unable to see blender root directory or access certain files from blender source(especially scripts) as one would expect with .sln being adjacent to blender dir. Also certain folders cannot be accessed. So, no easy access to files in solution explorer albeit majority of them are under different projects.

  2. git integration into project is not possible due to the structure. Anyway to get git working from sln dir?

If any seasoned VS users can me help with these hurdles it will be great! since, I’m new to this environment I might be missing something but I couldn’t find any info regarding this on the website. Hopefully, I can get some help here. Thanks!

There’s no way to do what you want, visual studio’s support for out of tree builds just isn’t there

Thanks for that quick reply. So, most of the devs on windows use vs code I would assume? If any of the devs who work in VS how would they do it? Atleast there should be a way to work with git.

different devs will have different workflows, but I use VS fulltime, all files involved with the c/c++ part of a build are in the solution generated, so there’s rarely any files i’m missing so to speak, the python script files, i honestly rarely touch, but if i do need them i just drag the one i need from the explorer into the editor pane or use notepad++ to edit them. For git I use either the git cli tools or tortoisegit

That sounds reasonable. I was under the impression integrated git system would be used just like in VS code. Thanks so much for the answers!

If you’re already proficient with vscode, you’re more than welcome to use it, we just don’t offer any support on it, since talking relatively new developers though configuring some settings in some random json file is a bit time intensive, time better spend elsewhere.

If you have it all figured out already, go use vscode! it’s a great environment, I love using it, … but hate teaching it :slight_smile:

1 Like