Cannot build blender

Hello, I tried to build blender in my m1 mac, by following Building Blender/Mac - Blender Developer Wiki , but it didn’t work.

Following is the error message, seems like a permission problem, but please let me know what I should do.

Showing Recent Issues
PhaseScriptExecution CMake\ PostBuild\ Rules /Users/kybin/blender-git/build_xcode/ (in target 'install' from project 'Blender')
    cd /Users/kybin/blender-git/blender
    /bin/sh -c /Users/kybin/blender-git/build_xcode/

-- Install configuration: "Debug"
-- Installing: /usr/local/
CMake Error at source/creator/cmake_install.cmake:47 (file):
  file INSTALL cannot make directory
  "/usr/local/": No such file or
Call Stack (most recent call first):
  cmake_install.cmake:48 (include)

Command PhaseScriptExecution failed with a nonzero exit code

In further investigation, I found cmake_install.cmake has these lines, which causes the problem in my guess. But still don’t know what to do.

  set(CMAKE_INSTALL_PREFIX "/usr/local")

I noticed that I’ve already build blender with make command in the guide. Still, it would be great that I can build inside of XCode.


I got it working.

What I did is removing of the build_xcode directory and rebuild with cmake . -B ../build_xcode/ -G "Xcode".

I guess what causes the problem is that I set path of cmake executable (xcode-select --reset) after the folder is generated.

1 Like

xcode-select shouldn’t affect cmake executable path since it’s not distributed with Xcode command line tools.

Maybe a stale CMakeCache.txt had CMAKE_INSTALL_PREFIX set to /usr/local likely due to make/ ninja generators.
One way to end up there is:

cmake . -B ../build_xcode 
oops I forgot to specify xcode so ctrl + C the process midway
cmake . -B ../build_xcode -G Xcode
oops now CMAKE_INSTALL_PREFIX is wrong.

this solved the problem indeed.

1 Like