Before compiling mGear solvers, ensure you have the following installed:
- CMake (latest version recommended)
- Compiler
- Windows: Microsoft Visual Studio
- Linux: GCC / Clang
- macOS: Xcode
- Maya Development Kit (Maya SDK) for the respective version
- C++ Build Tools
- CMake Generator matching your platform
- Execute the following commands from the cmake folder where FindMaya.cmake is
To generate the build solution for Visual Studio, run the following commands:
cmake -G "Visual Studio 16 2019" -A x64 -DMAYA_VERSION=2024 ../
cmake -G "Visual Studio 16 2019" -A x64 -DMAYA_VERSION=2025 ../
cmake -G "Visual Studio 17 2022" -A x64 -DMAYA_VERSION=2025 ../
To compile the solution:
cmake --build . --config Release
For Linux, use Unix Makefiles as the generator:
cmake -G "Unix Makefiles" -DMAYA_VERSION=2025 ../
cmake --build . --config Release
Use Xcode as the generator and specify the architecture:
cmake -G "Xcode" -DMAYA_VERSION=2024 -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" ../
cmake -G "Xcode" -DMAYA_VERSION=2025 -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" ../
If the compiler is not found, reset Xcode tools:
sudo xcode-select --reset
For Maya 2024 and later, you should compile a universal binary:
cmake -G "Xcode" -DMAYA_VERSION=2024 \
-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \
-DMaya_DIR=/Applications/Autodesk/maya2024/Maya.app/Contents/ ../
cmake -G "Xcode" -DMAYA_VERSION=2025 \
-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \
-DMaya_DIR=/Applications/Autodesk/maya2025/Maya.app/Contents/ ../
To verify that the compiled binary supports both architectures:
lipo -info mgear_solvers.bundle