Cmake for Xcode having issues w/ 2.8

Following directions at https://wiki.blender.org/wiki/Building_Blender/Mac for setting up to develop w/ Xcode. Able to build w/ no problems just using make. But cmake is issuing errors like…

Configuring incomplete, errors occurred!

See also “/Users/chuck/git/blender-build-xcode-2.8/cmakebuild/CMakeFiles/CMakeOutput.log”.

That’s even before I click Generate. Clicking on Generate unsurprisingly produces

Error in configuration process, project files may be invalid

Wondering if anyone has advice or some updated documentation.

Thx,
~chuck

I would attach the log file but I don’t seem to be able to here. Not sure what best practice on this site is for that.

Never mind. Problem solved. I had an automated build script that was stomping on the same folder. I got it working. Documentation on the web site is fine. Sorry for the noise.

If you are writing your own code in Blender, go with Visual Studio Code instead. It offers far better support for C++ than XCode does. Of course if you care only about building Blender , Xcode is fine.

Do you think coding in C is also better in Visual Studio on Mac?

The issue I have with XCode and probably most developer’s too is that it has very poor support for those languages , in terms of refactoring , autocompletion etc.

XCode is mainly focused on Swift and ObjectiveC which are very far the most popular languages on MacOS and of course iOS, because both use the same OS called “Darwin” which uses those two languages.

Visual Studio runs on Mac but does not support C/C++ because its basically Xamarine’s old IDE, which was the company behind MONO, .NET port on MacOS and iOS so it supports only C#. Xamarine was bought by Microsoft cause Microsoft wanted to provided official support for iOS and Android after its colossal failure to convince people to move to Windows Mobile.

Visual Studio Code on the other hand is a diffirent beast, made on top of diffirent technologies that are basically Javascript driven. So its supports Javascript and HTML/CSS out of the box but its C/C++ support is very solid too.

Another IDE I have tested for Unreal and C++ has been CodeLite which as its name is very lite on resources but also pretty powerful and with solid support for C/C++ and CMake.

I am not a fan of Eclipse because of how slow it can be and I have not tried Netbeans because I am no fan of Java runtime.

With C++ I can see why refactoring and autocompletion might be a problem (templates, class inheritance, etc…) but C is much simpler, so there is not much I’m missing while using Xcode.
I was just wondering if you prefer a certain IDE for blender development on mac, when working on the C code.

I am in the process of developing a commercial Blender build and I have to build for MacOS , Ubuntu and Windows. My main developing platform is MacOS but I have to build and test on all other platforms too so for me an IDE that works very well on all 3 platforms is a must. I dont like the idea of having to fight 3 diffirent IDEs.

So far Visual Studio Code has won my heart. It just works, requires almost zero setup and the setup is almost exactly the same in all 3 platforms. I had my reservations because its build on top of Web technology and I am no fan of Web Dev in general but, I was blown away by the fact that its search is actually faster than VS search. Overall its a very customisable powerful IDE, very approachable and very well designed. One complain I have is its Git UI, at first I thought it did only commits and then I finally discovered that the UI was hidden in a button and it did a lot more. So I dropped even my git client which was tortoisegit on windows and GitKraken on the other platforms. I love also the Cobalt Theme and Git Lens which makes it easy to browse through blender’s massive and chaotic git commit history. I have not tested the Cmake functionality much so far but I am sure its pretty powerful too.

I have been a Microsoft hater all my life but Windows 10 and Visual Studio Code has made it particularly difficult to hate Microsoft lately :smiley:

Technically speaking no IDE is a real IDE, power wise they are pretty weak but C/C++ wise I would have to say VSC is the closest to a real IDE I have found so far.

1 Like

Can you build, debug, profile etc Blender within VSC on Mac? Any pointers on how to best get a good setup?

Build check
Debug check
Profile … not sure on that one I have not tried it.

A very good setup, because simply good is not good enough ;), is super easy. You download VSC , open it to the folder you have Blender source code and then install following extensions

  1. C/C++ (must have)
  2. Python (must have)
  3. CMake (optional)
  4. CMake tools (optional)
  5. GitLens (optional) - helps you browse through git commits
  6. Git History (optional) - helps you browser through a file’s git history
  7. CobaltTheme2 (optional if you like blue themes lime me :slight_smile: )

Installation is just a single click. From there on you optionally make your own tasks. I have one task for triggering the debugger and one for building Blender. A simple google will have you up and running on 5 minutes. VSC comes with its own internal terminal so technically speaking you dont need those tasks but if you are like me not a fan of terminal and command line tools it does make things a single click away.

Profile wise I will bet that it works the same as debugging, make a task to trigger the profiler passing it the command line arguments it expects. Profiling is a huge things for C/C++ so I am sure there are like a ton of tools that can be used via command line and VSC can use tasks to access them or you can use the internal command line if you dont mind the typing. Its completely up to you.

VSC come with ready templates for task for the usual suspects build tools and debuggers so maybe the same applies for profilers too. So basically you only have to type in the commands you want to execute in the command line/terminal.

for example this is the task I use to debug on windows

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(Windows) Launch",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "C:/Users/kilon/ephestos/build_windows__x64_vc15_Debug/bin/Debug/blender.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "C:/Users/kilon/ephestos/build_windows__x64_vc15_Debug/bin/Debug",
            "environment": [],
            "externalConsole": true
        }
    ]
}

and this for building

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build",
            "type": "shell",
            "command": "cd C:\\Users\\kilon\\ephestos\\blender && make debug",
            "args": [
            ],
            "group": {
                "kind":"build",
                "isDefault": true
            },
            "presentation": {
                // Reveal the output only if unrecognized errors occur.
                "reveal": "silent"
            },
            // Use the standard MS compiler pattern to detect errors, warnings and infos
            "problemMatcher": "$msCompile"
        }
    ]
}

I am not on mac right now so I cannot post the mac version but I think you get the idea.