This page describes how to build Coin 3D for the Macintosh operating system.
Note: The Xcode project in the build directory is currently broken. These instructions use the autoconf toolchain.
Install the required tools and development libraries:
Download Xcode and install using App Store (see https://developer.apple.com/support/xcode/).
Download the doxygen DMG package from here. The current package that has been tested is Doxygen-1.8.14.dmg.
Double-click on the downloaded package and follow the instructions presented by the installer (drag Doxygen application to Applications folder).
Add the doxygen binary to your PATH:
export PATH=/Applications/Doxygen.app/Contents/Resources:$PATH
The Wizzer Works Coin 3D source code resides on Sourceforge (https://sourceforge.net/projects/coin3d/). It is in a Git repository and the following command can be used to retrieve the source:
git clone git://git.code.sf.net/p/coin3d/code coin3d-code
To build the source modified for the Wizzer Works Magic Lantern project, switch to the magiclantern branch:
git checkout magiclantern
Note that the master branch contains the source from the original Coin3D v3.1.3 tar package. The master branch will not be modified unless it is necessary to be maintained (i.e. bug fixes) outside the scope of Magic Lantern.
The version of g++ distrubuted with Xcode does not cleanly compile the Coin 3.1.3 source. Use the following patches to rectify this issue.
In "include/Inventor/SbBasic.h", add the following #include reference:
#include <Inventor/C/errors/debugerror.h>
In "src/fonts/freetype.cpp", add the following #include reference at line 49:
#include <cstdlib>
Do this right before the extern "C" code.
Build the libraries and distribution elements (i.e. documentation) in a separate directory. Be sure to enable the HTML and man page generation.
mkdir coin3d-build
cd coin3d-build
../coin3d-code/configure --enable-html --enable-man
Other useful configure options include:
Build the Coin library, libCoin.dylib:
make
To install the library, header files and documentation, do the following:
sudo make install
Note: you may need to create the /Library/Frameworks/Inventor.framework/Versions/C/Resources/include directory by hand for install to complete successfully:
sudo mkdir /Library/Frameworks/Inventor.framework/Versions/C/Resources/include
The library and documentation will be installed in /Library/Frameworks/Inventor.framework.