Building Samples on MacOS

Important: You need to set up your environment as described in Setting up your build environment before building the samples.

Plug-in samples are located in $DEVKIT_LOCATION/devkit/plug-ins/ and standalone application samples are located in $DEVKIT_LOCATION/devkit/applications/. Each individual sample is in its own dedicated directory. Change to the sample's directory to build it.

For example, the circleNode plug-in sample, is located in the circleNode directory. To build it, change directory to circleNode:

> cd $DEVKIT_LOCATION/devkit/plug-ins/circleNode

Before building a sample, you need to run cmake once to generate either an Xcode project or a UNIX makefile. Xcode version 7.3.1 or higher must be installed to generate an Xcode project.

To generate a makefile, open a terminal window and run:

> cmake -H. -Bbuild -G "Unix Makefiles"

To generate an Xcode project, open a terminal window and run:

    > cmake -H. -Bbuild -G Xcode

Note: To build the cgFx plug-in, unarchive Cg.framework.tar in $DEVKIT_LOCATION/lib before building the project.

The cmake command should exit with no errors and create a build directory.

Run cmake again to build the sample:

> cmake --build build

The executable or plug-in will be located under the build directory if it was built using a UNIX makefile. It will be under the build/Debug directory if it was built using an Xcode project.

If you generated an Xcode project, you can also build the project from within Xcode.

Plug-ins have the suffix bundle. For example, the circleNode plug-in will be called circleNode/build/circleNode.bundle.

Unlike applications that can be run from the command line, plug-ins must be loaded into Maya.

Important: Do not rebuild a plug-in that is already loaded into Maya. Unload the plug-in before you rebuild it.