利用者:Jr100/CMake/MacOSX

提供: wiki
移動先: 案内検索

Introduction

Building Blender on any system is very easy. All you will need are a couple of software tools and of course, a computer! The instructions below apply to MacOSX and should work on any version. The steps in building Blender are:

  1. Get the software
  2. Get the source
  3. Build it!

Installing The Software

To get and build Blender, you need a number of packages installed on your system. To get them follow these simple instructions.

Git

Git is a version control system that we use to download, list changes to, and update Blender's source. For a more in-depth overview, look at this page. To install Git, go to http://www.git-scm.com/download and select the installer for MacOSX.

Test The Install

Once it has installed, open up your terminal and test it by typing

git --help

If you see output like,

usage: git [--version] [--help] [-C <path>] [-c name=value].....

you will know that it has been installed correctly.

CMake

CMake is a family of tools designed to build, test and package software. We use it to configure our code for building. To install go to http://www.cmake.org/download/ there you can download the package for MacOSX.

Getting The Source

Getting the source is as easy as running a few commands. Be warned that Blender's source is over 300 megabytes and it will take a little while to download.

Creating the blender-git folder

To get the source, you first have to have somewhere to put it! So, the first thing you should do, is open up terminal.app and type in these commands to create and go to a new blender folder.

mkdir ~/blender-git
cd ~/blender-git

Checking Out The Source

Now it's time to actually get the source code, just type these commands into the terminal and away you go!

git clone http://git.blender.org/blender.git

Updating

If you ever want to update your code to the latest version, it is suggested that you do this every day, just use these commands.

cd ~/blender-git/blender
git pull --rebase
git submodule foreach git pull --rebase origin master

Building It

To build Blender, open up CMake and follow the instructions below.

Configuring The Build

  1. Set the source path to be blender-git/blender
  2. Create a new folder in blender-git called build and set the build directory to blender-git/build
  3. Click the configure button and select Unix Makefiles on the popup. Don't be frightened by the red, that is fine.
  4. After that has finished, click the generate button to generate the makefiles.
  5. When that is finished, close CMake.

Building The Source

To build the source, follow the steps and wait while it compiles. Warning: on first build, the code takes an average of 2 hours to compile, after that, it will only compile what you have changed.

cd ~/blender-git/build
make
make install

Testing The Build

To test the newly compiled version of Blender, go to blender-git/blender and run

blender.app

and Blender will open.

Closing Notes

We hope that you have found this helpful and informative. If you have any questions or the build didn't work for some reason, contact a developer on the #blendercoders irc channel. Thanks, The Blender Developer Team