The CMake tool is used to both to generate projects for your plug-ins and applications, and to build the plug-ins and applications from the projects it generated.
Projects are generated by calling a CMake Generator.
A CMakeLists.txt file in the plug-in or application directory provides information about the libraries, files, and source needed to generate the project.
The Maya devkit supports three generators:
Projects are generated using
cmake -H. -Bbuild -G <generator>
The -Bbuild argument is used to specify the project file target directory. You can change the target directiory by modifying this argument.
For example, to generate an XCode poject in the project directory, use
cmake -H. -Bproject -G Xcode
Detailed information about generators is available in the CMake documentation.
After your project is generated, you can use CMake to build the plug-in or application
cmake --build build/
You can also build the project from within Xcode or Visual Studio, depending on the generator you used.
If you generated the project to a directory other than build, use that directory in the call to cmake. For example, if you generated the project to the project directory, use
cmake --build project/
Your built application or plug-in will be located in the top level of the build directory if you generated your project using Unix Makefiles. If you used the Xcode or Visual Studio 14 2015 Win64 generator, your plug-in or application will be located under build's Debug subdirectory.
You can run your applications directly from the command line or from Windows Explorer.
If you set MAYA_PLUG_IN_PATH path in Maya.env as described in Setting Up Your Build Environment, you can copy your plug-in to the MAYA_PLUG_IN_PATH and it will be loaded automatically into Maya. You can also choose to not place your plug-in in MAYA_PLUG_IN_PATH and instead load it manually.
Important: Do not rebuild a plug-in that is already loaded into Maya. Unload the plug-in before you rebuild it.
Note: Plug-ins built on different platforms will have different extensions. Plug-ins built on Windows will have the mll extension. Plug-ins built on Linux will have the so extension. Plug-ins built on MacOS will have the bundle extension.