make.bat: Add support for building with ninja.
[blender.git] / build_files / windows / configure_msbuild.cmd
1 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%WINDOWS_ARCH%" %TESTS_CMAKE_ARGS%
2
3 if "%BUILD_ARCH%"=="x64" (
4         set MSBUILD_PLATFORM=x64
5 ) else if "%BUILD_ARCH%"=="x86" (
6         set MSBUILD_PLATFORM=win32
7 )
8
9 if NOT EXIST %BUILD_DIR%\nul (
10         mkdir %BUILD_DIR%
11 )
12
13 if "%MUST_CLEAN%"=="1" (
14         echo Cleaning %BUILD_DIR%
15         msbuild ^
16                 %BUILD_DIR%\Blender.sln ^
17                 /target:clean ^
18                 /property:Configuration=%BUILD_TYPE% ^
19                 /verbosity:minimal ^
20                 /p:platform=%MSBUILD_PLATFORM%
21 )
22
23 if NOT EXIST %BUILD_DIR%\Blender.sln set MUST_CONFIGURE=1
24 if "%NOBUILD%"=="1" set MUST_CONFIGURE=1
25
26 if "%MUST_CONFIGURE%"=="1" (
27
28         if NOT "%verbose%" == "" (
29                 echo %CMAKE% %BUILD_CMAKE_ARGS% -H%BLENDER_DIR% -B%BUILD_DIR% 
30         )
31
32         cmake ^
33                 %BUILD_CMAKE_ARGS% ^
34                 -H%BLENDER_DIR% ^
35                 -B%BUILD_DIR% 
36
37         if %ERRORLEVEL% NEQ 0 (
38                 echo "Configuration Failed"
39                 exit /b 1
40         )
41 )
42
43 echo call "%VCVARS%" %BUILD_ARCH% > %BUILD_DIR%\rebuild.cmd
44 echo "%CMAKE%" . >> %BUILD_DIR%\rebuild.cmd
45 echo echo %%TIME%% ^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd
46 echo msbuild ^
47         %BUILD_DIR%\Blender.sln ^
48         /target:build ^
49         /property:Configuration=%BUILD_TYPE% ^
50         /maxcpucount:2 ^
51         /verbosity:minimal ^
52         /p:platform=%MSBUILD_PLATFORM% ^
53         /flp:Summary;Verbosity=minimal;LogFile=%BUILD_DIR%\Build.log >> %BUILD_DIR%\rebuild.cmd
54 echo msbuild ^
55         %BUILD_DIR%\INSTALL.vcxproj ^
56         /property:Configuration=%BUILD_TYPE% ^
57         /verbosity:minimal ^
58         /p:platform=%MSBUILD_PLATFORM% >> %BUILD_DIR%\rebuild.cmd
59 echo echo %%TIME%% ^>^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd