This page explains how to compile the latest FreeCAD source code on Mac OS X.
- 1 Prerequisites
- 2 Installing the Dependencies
- 3 Getting the source
- 4 Building FreeCAD
- 5 Updating
- 6 Troubleshooting
First of all, you will need to install the following software.
Xcode Development Tools
Unless you want to use the Xcode IDE for FreeCAD development, you will only need to install the Command Line Tools. To do this on 10.9 and later, open Terminal, run the following command, and then click Install in the dialog that comes up.
For other versions of OS X, you can get the package from the Apple developer downloads page (sign in with the same Apple ID you use for other Apple services). Specifically, you will need to download Development Tools 3.2 for OS X 10.6, and Command Line Tools 4.8 for OS X 10.8.
You will want to use a package manager to install prerequisite software, this page gives instructions for two of the common package managers in use for OS X: Homebrew and MacPorts. It's easiest to pick one package manager for your system, and not have multiple package managers installed concurrently. Currently (October 2015), Homebrew has more up-to-date libraries relating to FreeCAD than MacPorts.
To install Homebrew, enter the following in Terminal:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
To install MacPorts, follow the instructions from their website
FreeCAD uses CMake to build the source. Homebrew and MacPorts can install the command line version of CMake, or if you prefer using a GUI application, install the latest version from http://www.cmake.org/download.
For the command line version of CMake, from a terminal use either Homebrew:
brew install cmake
sudo port install cmake
Installing the Dependencies
All of the needed libraries can be installed using either Homebrew or MacPorts.
brew tap homebrew/science brew tap sanelson/freecad brew install boost eigen freetype oce python qt pyside pyside-tools xerces-c boost-python brew install --without-framework --without-soqt sanelson/freecad/coin brew install --HEAD pivy
sudo port install boost eigen3 freetype oce py27-pyside-tools xercesc Coin
Getting the source
In this guide, the source and build folders are created in /Users/username/FreeCAD, but you can of course use whatever folder you want.
mkdir ~/FreeCAD cd ~/FreeCAD
To get the FreeCAD source code, run:
git clone git://git.code.sf.net/p/free-cad/code FreeCAD-git
Alternatively, you can use the github mirror: https://github.com/FreeCAD/FreeCAD_sf_master.git
First, create a new folder for the build:
Now you will need to run CMake to generate the build files. Several options will need to be given to CMake, which can be accomplished either with the CMake GUI application, or via the command line.
|BUILD_ROBOT||0 (unchecked)||The robot module depends on Orocos KDL, and the version of KDL included with FreeCAD currently (October 2015) doesn't build on recent MacOS. To build the robot module, install Orocos KDL (no MacPorts package is currently available), and specify FREECAD_USE_EXTERNAL_KDL=1 instead.|
|FREECAD_USE_EXTERNAL_PIVY||1 (checked)||Homebrew only|
|FREETYPE_INCLUDE_DIR_freetype2||/usr/local/include/freetype2 for Homebrew, /opt/local/include/freetype2 for MacPorts||Only CMake version older than 3.1.0|
|QT_QMAKE_EXECUTABLE||/opt/local/libexec/qt4/bin/qmake||MacPorts only (and probably temporary|
|FREECAD_CREATE_MAC_APP||1 (checked)||If you want to make a FreeCAD.app Then when you run "make install" it will create the FreeCAD.app where ever CMAKE_INSTALL_PREFIX is set to.|