Share

Build your operators and their Bifrost pack

Bifrost operators are built using CMake. By using the CMakeLists.txt files packaged with the examples, you will be able to build the operator into libraries, run cpp2json to generate the node's definition JSON file, and package all the necessary files into a Bifrost pack for distribution in only two steps.

The first call to cmake is used to generate a Makefile or a Visual Studio project. The second call to cmake uses the Makefile or project to build your operator and create a Bifrost pack.

To build your operator and its Bifrost pack:

  1. Open a terminal or command window.

    If you are building your operator on Windows, open a Visual Studio 2019 command window.

    If you are building your operator on macOS or Linux, open a terminal window.

  2. Make sure that the cmake command is in your path. If you are building your operator on Linux, make sure that gcc is also in your path.

  3. Set the BIFROST_LOCATION environment variable to point to your Bifrost installation.

    If you are building on Windows, your path to the Bifrost installation can include spaces, but it cannot include quotation marks.

    Platform Default Bifrost location
    Windows C:\Program Files\Autodesk\Bifrost\<Maya_version>\<Bifrost_version>\bifrost\
    macOS /Applications/Autodesk/bifrost/<Maya_version>/<Bifrost_version>/bifrost/
    Linux /usr/autodesk/bifrost/<Maya_version>/<Bifrost_version>/bifrost/
  4. Run cmake a first time to create a Makefile or Visual Studio project:

     cmake  -S <operator_directory> -B build_output -DCMAKE_INSTALL_PREFIX=bifrost_packs

    The build files will be created in the build location directory you passed to cmake.

    -DCMAKE_INSTALL_PREFIX points to the directory where your Bifrost pack will be installed. By default, the Bifrost pack will be installed in the build directory. However, it is good practice to install Bifrost packs in a different location than the build files.

    On Macs with Apple Silicon chips, the target architecture will be arm64 by default. Similarly, on Macs with Intel chips, the target architecture will be Intel x86_64 by default. You can choose to build for both architectures using the CMAKE_OSX_ARCHITECTURES option:

     cmake  -S  <operator_directory>  -B build_output -DCMAKE_INSTALL_PREFIX=bifrost_packs -DCMAKE_OSX_ARCHITECTURES=x86_64;arm64

    If you need to rebuild, delete the build directory first.

  5. Run cmake a second time to build the operator and create the pack:

     cmake --build build_output --target install

    If you are building on Windows, you will need to build with the --config Release option:

     cmake --build build_output --target install --config Release

Your Bifrost pack will be in the bifrost_packs directory and will be named SimpleString-1.0.0 unless you modified the CMakeLists.txt files to use a different project name.

For more information on building operators, see Building a Bifrost operator.

Continue to testing your nodes.

Was this information helpful?