Skip to content

Commit beac12e

Browse files
committed
Solvers: Build: Add Maya 2022 support to Windows build script
build_solvers.bat now auto-detects Maya 2022 alongside 2023-2027 and maps it to the Visual Studio 2019 generator (Maya 2022 was built against VS 2019). BUILD.md documents the Maya 2022 CMake command and the helper script usage. Rebuilt mgear_solvers.mll for Maya 2022 to include the springGravity solver that was missing from the previously distributed binary.
1 parent 64da0fa commit beac12e

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

‎BUILD.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,27 @@ Before compiling mGear solvers, ensure you have the following installed:
1717
To generate the build solution for Visual Studio, run the following commands:
1818

1919
```sh
20+
cmake -G "Visual Studio 16 2019" -A x64 -DMAYA_VERSION=2022 ../
21+
cmake -G "Visual Studio 16 2019" -A x64 -DMAYA_VERSION=2023 ../
2022
cmake -G "Visual Studio 16 2019" -A x64 -DMAYA_VERSION=2024 ../
2123
cmake -G "Visual Studio 17 2022" -A x64 -DMAYA_VERSION=2025 ../
2224
cmake -G "Visual Studio 17 2022" -A x64 -DMAYA_VERSION=2026 ../
2325
cmake -G "Visual Studio 17 2022" -A x64 -DMAYA_VERSION=2027 ../
2426
```
2527

28+
Or use the helper script which auto-detects the installed Maya SDK and picks the matching Visual Studio generator:
29+
30+
```bat
31+
:: Auto-detect (Maya 2022-2027)
32+
build_solvers.bat
33+
34+
:: Target a specific version
35+
build_solvers.bat 2022
36+
37+
:: Clean build
38+
build_solvers.bat clean 2022
39+
```
40+
2641
To compile the solution:
2742
```sh
2843
cmake --build . --config Release

‎build_solvers.bat‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ setlocal
55
:: build_solvers.bat -- Build mGear Maya solver plugins (.mll)
66
::
77
:: Usage:
8-
:: build_solvers.bat (auto-detect Maya 2023-2027)
8+
:: build_solvers.bat (auto-detect Maya 2022-2027)
99
:: build_solvers.bat 2027 (target a specific Maya version)
1010
:: build_solvers.bat clean (delete build folder and rebuild)
1111
:: build_solvers.bat clean 2027 (clean + specific version)
@@ -29,7 +29,7 @@ if /i "%~1"=="clean" (
2929

3030
:: ----- Auto-detect Maya version if not specified ---------------------------
3131
if "%MAYA_VER%"=="" (
32-
for %%V in (2027 2026 2025 2024 2023) do (
32+
for %%V in (2027 2026 2025 2024 2023 2022) do (
3333
if exist "C:\Program Files\Autodesk\Maya%%V\include\maya\MFn.h" (
3434
set "MAYA_VER=%%V"
3535
goto :found_maya
@@ -44,9 +44,11 @@ if "%MAYA_VER%"=="" (
4444
:found_maya
4545

4646
:: ----- Determine Visual Studio generator -----------------------------------
47+
:: Maya 2022-2024 were built with VS 2019; 2025+ with VS 2022.
4748
set "VS_GEN=Visual Studio 17 2022"
4849
if "%MAYA_VER%"=="2024" set "VS_GEN=Visual Studio 16 2019"
4950
if "%MAYA_VER%"=="2023" set "VS_GEN=Visual Studio 16 2019"
51+
if "%MAYA_VER%"=="2022" set "VS_GEN=Visual Studio 16 2019"
5052

5153
set "MAYA_ROOT=C:\Program Files\Autodesk\Maya%MAYA_VER%"
5254
set "BUILD_DIR=%CMAKE_DIR%\build_%MAYA_VER%"
11.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)