@@ -75,6 +75,13 @@ SET BUILD_PACKAGE=1
7575SET BUILD_TYPE = Release
7676SET MMSOLVER_DEBUG = 1
7777
78+ SET RELEASE_FLAG =
79+ SET BUILD_TYPE_DIR = debug
80+ IF " %BUILD_TYPE% " == " Release" (
81+ SET RELEASE_FLAG = --release
82+ SET BUILD_TYPE_DIR = release
83+ )
84+
7885:: Build options, to allow faster compilation times. (not to be used by
7986:: users wanting to build this project.)
8087SET MMSOLVER_BUILD_PLUGIN = 1
@@ -107,6 +114,14 @@ SET MMSOLVERLIBS_INSTALL_DIR="%BUILD_MMSOLVERLIBS_DIR_BASE%\install\maya%MAYA_VE
107114SET MMSOLVERLIBS_CMAKE_CONFIG_DIR = " %MMSOLVERLIBS_INSTALL_DIR% \lib\cmake\mmsolverlibs_cpp"
108115SET MMSOLVERLIBS_RUST_DIR = " %BUILD_MMSOLVERLIBS_DIR_BASE% \rust_windows64_maya%MAYA_VERSION% \%BUILD_TYPE_DIR% "
109116
117+ :: Where to find the mmsolverlibs Rust libraries and headers.
118+ SET MMSOLVERLIBS_INSTALL_PATH = %BUILD_MMSOLVERLIBS_DIR_BASE% \install\maya%MAYA_VERSION% _windows64\
119+ SET MMSOLVERLIBS_ROOT = %PROJECT_ROOT% \lib
120+ SET MMSOLVERLIBS_RUST_ROOT = %MMSOLVERLIBS_ROOT% \mmsolverlibs
121+ SET MMSOLVERLIBS_CPP_TARGET_DIR = %BUILD_MMSOLVERLIBS_DIR_BASE% \rust_windows64_maya%MAYA_VERSION%
122+ SET MMSOLVERLIBS_LIB_DIR = %MMSOLVERLIBS_CPP_TARGET_DIR% \%BUILD_TYPE_DIR%
123+ SET MMSOLVERLIBS_INCLUDE_DIR = %MMSOLVERLIBS_ROOT% \include
124+
110125:: Paths for dependencies.
111126SET EXTERNAL_OCIO_BUILD_DIR = %BUILD_OCIO_DIR_BASE% \cmake_win64_maya%MAYA_VERSION% _%BUILD_TYPE% \ext\dist
112127SET OCIO_INSTALL_DIR = %BUILD_OCIO_DIR_BASE% \install\maya%MAYA_VERSION% _windows64\
@@ -134,6 +149,29 @@ SET ZLIB_LIBRARY=%EXTERNAL_OCIO_BUILD_DIR%\%ZLIB_RELATIVE_LIB_PATH%
134149
135150SET minizip_DIR = %EXTERNAL_OCIO_BUILD_DIR% \%MINIZIP_RELATIVE_CMAKE_DIR%
136151
152+ :: Check if 'cxxbridge.exe' is installed or not, and then install it if
153+ :: not.
154+ ::
155+ :: https://stackoverflow.com/questions/4781772/how-to-test-if-an-executable-exists-in-the-path-from-a-windows-batch-file
156+ where /Q cxxbridge
157+ IF %ERRORLEVEL% EQU 1 (
158+ :: Install the needed 'cxxbridge.exe' command.
159+ ::
160+ :: NOTE: When changing this version number, make sure to update the
161+ :: CXX version used in the C++ buildings, and all the build scripts
162+ :: using this value:
163+ :: './Cargo.toml'
164+ :: './scripts/internal/build_mmSolver_windows64.bat'
165+ :: './scripts/internal/build_mmSolver_linux.bash'
166+ :: './scripts/internal/build_mmSolverLibs_windows64.bat'
167+ :: './scripts/internal/build_mmSolverLibs_linux.bash'
168+ %RUST_CARGO_EXE% install cxxbridge-cmd --version 1.0.129
169+ )
170+ SET MMSOLVERLIBS_CXXBRIDGE_EXE = " %USERPROFILE% \.cargo\bin\cxxbridge.exe"
171+ :: Convert back-slashes to forward-slashes.
172+ :: https://stackoverflow.com/questions/23542453/change-backslash-to-forward-slash-in-windows-batch-file
173+ SET " MMSOLVERLIBS_CXXBRIDGE_EXE = %MMSOLVERLIBS_CXXBRIDGE_EXE:\ =/ % "
174+
137175:: MinGW is a common install for developers on Windows and
138176:: if installed and used it will cause build conflicts and
139177:: errors, so we disable it.
@@ -215,6 +253,8 @@ CHDIR "%BUILD_DIR%"
215253 -DMMSOLVER_BUILD_TESTS=%MMSOLVER_BUILD_TESTS% ^
216254 -DMAYA_LOCATION=%MAYA_LOCATION% ^
217255 -DMAYA_VERSION=%MAYA_VERSION% ^
256+ -DMMSOLVERLIBS_CXXBRIDGE_EXE=%MMSOLVERLIBS_CXXBRIDGE_EXE% ^
257+ -DMMSOLVERLIBS_LIB_DIR=%MMSOLVERLIBS_LIB_DIR% ^
218258 -Dmmsolverlibs_rust_DIR=%MMSOLVERLIBS_RUST_DIR% ^
219259 -Dmmsolverlibs_cpp_DIR=%MMSOLVERLIBS_CMAKE_CONFIG_DIR% ^
220260 -DOpenColorIO_DIR=%OCIO_CMAKE_CONFIG_DIR% ^
@@ -261,17 +301,17 @@ CHDIR "%PROJECT_ROOT%"
261301exit /b 0
262302
263303:failed_to_generate
264- echo Failed to generate build files.
304+ echo Failed to generate build files for mmSolver component .
265305exit /b 1
266306
267307:failed_to_build
268- echo Failed to build.
308+ echo Failed to build mmSolver component .
269309exit /b 1
270310
271311:failed_to_install
272- echo Failed to install.
312+ echo Failed to install mmSolver component .
273313exit /b 1
274314
275315:failed_to_build_zip
276- echo Failed to build the ZIP package file.
316+ echo Failed to build the ZIP package file for mmSolver component .
277317exit /b 1
0 commit comments