Mac: Compile Latest Releases of Both 2.7 and 2.8

I am using macOS 10.14 beta to compile the latest version of Blender 2.8, and it works like a charm. In fact I love using make to compile so much :heart_eyes: that I never download the compiled builds anymore.

I want to do the same for the latest updates for 2.7 as well, but I am not having luck with this.

I know that the Master branch is for 2.7 and the blender2.8 branch is for 2.8, and that I just need to checkout the appropriate branch and run make on it to get the latest build for that branch.

My question is: how can I specify where to place the final build files? Right now, it goes to build_darwin, and I manually move it to /Applications and rename it to the correct version (i.e. Blender 2_7.app or Blender 2_8.app).

I would like to have the 2.7 and 2.8 versions end up in different folders while they are built; is this possible?

The easiest is to do a second checkout in another folder, containing its own blender, lib and build_darwin folders.

If you want to save disk space and avoid downloading things twice, you can use a worktree and symlinks. Assuming you have an existing build in ~/blender-build:

cd ~/blender-build/blender

mkdir ~/other-build
git worktree add ~/other-build/blender master
ln -s ~/blender-build/lib ~/other-build/lib

cd ~/other-build/blender
make

I finally had a chance to try the worktree setup, and I do like it. I had never used this feature of Git, being that it seems to be a recent addition.

The setup works very well for 2.8, but when I run the make on 2.7, I get the following error:

CMake Error: The source “/Users/michaelsheaver/Git Repos/Blender/blender_master/CMakeLists.txt” does not match the source “/Users/michaelsheaver/Git Repos/Blender/blender/CMakeLists.txt” used to generate cache. Re-run cmake with a different source directory.
make: *** [all] Error 1

I did run a diff on the two files, and it shows there are 52 differences between the two. Is there something I did wrong here?

Also, should I run make update on the 2.7 worktree?

For now, I can just do a separate full checkout of master in its own folder, no problem. But I am curious what might be causing this.

you’ll probably want to use different build folders for the two builds.

I agree, and am going that route. I can compile 2.8 no problem, but even with the two repos completely separate and different branches checked out for each, the 2.7 compile still gives me that error.

I went ahead and deleted both the lib and build_darwin folders that are created during the make and build, and this time 2.7 compiled no problem.

I suspect that the issue might be that there might not be enough separation between the two repos, because of the way that the lib and build_darwin folders are positioned outside of the repos ( using …/…).

I will test this later.

That is indeed the problem, the commands I gave above use completely separate folders.

@brecht, please do accept my apology for this. I am a bit of a neat freak when it comes to managing code, repos, assets, and the like, since I have learned the hard way what happens when you don’t stay on top of it at all times. I was trying to keep my Blender repos organized “cleanly”, and having the extra levels offenders did not make any sense to me at the time.

Now that I have it organized the way you indicated, it does make perfect sense to me now. :blush:

Thank you for your patience and for confirming my suspicions.