Transform: remove unused argument
[blender.git] / make.bat
index dd82b1ca8a72f4d0ec17c3bfeaf522bd9d28b0c3..988cb5f4c68ea182d5b1c03ef124c2152562a7b1 100644 (file)
--- a/make.bat
+++ b/make.bat
@@ -1,7 +1,7 @@
 @echo off
 REM This batch file does an out-of-source CMake build in ../build_windows
 REM This is for users who like to configure & build Blender with a single command.
-
+setlocal EnableDelayedExpansion
 setlocal ENABLEEXTENSIONS
 set BLENDER_DIR=%~dp0
 set BLENDER_DIR_NOSPACES=%BLENDER_DIR: =%
@@ -12,10 +12,12 @@ if not "%BLENDER_DIR%"=="%BLENDER_DIR_NOSPACES%" (
 set BUILD_DIR=%BLENDER_DIR%..\build_windows
 set BUILD_TYPE=Release
 rem reset all variables so they do not get accidentally get carried over from previous builds
+set BUILD_DIR_OVERRRIDE=
 set BUILD_CMAKE_ARGS=
 set BUILD_ARCH=
 set BUILD_VS_VER=
 set BUILD_VS_YEAR=
+set BUILD_NGE=
 set KEY_NAME=
 set MSBUILD_PLATFORM=
 set MUST_CLEAN=
@@ -35,6 +37,12 @@ if NOT "%1" == "" (
        if "%1" == "debug" (
                set BUILD_TYPE=Debug
        REM Build Configurations
+       ) else if "%1" == "noge" (
+               set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_GAMEENGINE=OFF -DWITH_PLAYER=OFF
+               set BUILD_NGE=_noge
+       ) else if "%1" == "builddir" (
+               set BUILD_DIR_OVERRRIDE="%BLENDER_DIR%..\%2"
+               shift /1
        ) else if "%1" == "with_tests" (
                set TESTS_CMAKE_ARGS=-DWITH_GTESTS=On
        ) else if "%1" == "full" (
@@ -185,8 +193,10 @@ if %ERRORLEVEL% NEQ 0 (
 )
 
 
-set BUILD_DIR=%BUILD_DIR%_%TARGET%_%BUILD_ARCH%_vc%BUILD_VS_VER%_%BUILD_TYPE%
-
+set BUILD_DIR=%BUILD_DIR%_%TARGET%%BUILD_NGE%_%BUILD_ARCH%_vc%BUILD_VS_VER%_%BUILD_TYPE%
+if NOT "%BUILD_DIR_OVERRRIDE%"=="" (
+       set BUILD_DIR=%BUILD_DIR_OVERRRIDE%
+)
 
 where /Q cmake
 if %ERRORLEVEL% NEQ 0 (
@@ -240,13 +250,30 @@ if "%MUST_CONFIGURE%"=="1" (
                goto EOF
        )
 )
+if DEFINED MSVC_VC_DIR echo call "%MSVC_VC_DIR%\vcvarsall.bat" > %BUILD_DIR%\rebuild.cmd 
+if DEFINED MSVC_VS_DIR echo call "%MSVC_VS_DIR%\Common7\Tools\VsDevCmd.bat" > %BUILD_DIR%\rebuild.cmd 
+echo cmake . >> %BUILD_DIR%\rebuild.cmd
+echo msbuild ^
+       %BUILD_DIR%\Blender.sln ^
+       /target:build ^
+       /property:Configuration=%BUILD_TYPE% ^
+       /maxcpucount:2 ^
+       /verbosity:minimal ^
+       /p:platform=%MSBUILD_PLATFORM% ^
+       /flp:Summary;Verbosity=minimal;LogFile=%BUILD_DIR%\Build.log >> %BUILD_DIR%\rebuild.cmd
+echo msbuild ^
+       %BUILD_DIR%\INSTALL.vcxproj ^
+       /property:Configuration=%BUILD_TYPE% ^
+       /verbosity:minimal ^
+       /p:platform=%MSBUILD_PLATFORM% >> %BUILD_DIR%\rebuild.cmd
+
 if "%NOBUILD%"=="1" goto EOF
 
 msbuild ^
        %BUILD_DIR%\Blender.sln ^
        /target:build ^
        /property:Configuration=%BUILD_TYPE% ^
-       /maxcpucount ^
+       /maxcpucount:2 ^
        /verbosity:minimal ^
        /p:platform=%MSBUILD_PLATFORM% ^
        /flp:Summary;Verbosity=minimal;LogFile=%BUILD_DIR%\Build.log
@@ -264,7 +291,7 @@ msbuild ^
 
 echo.
 echo At any point you can optionally modify your build configuration by editing:
-echo "%BUILD_DIR%\CMakeCache.txt", then run "make" again to build with the changes applied.
+echo "%BUILD_DIR%\CMakeCache.txt", then run "rebuild.cmd" in the build folder to build with the changes applied.
 echo.
 echo Blender successfully built, run from: "%BUILD_DIR%\bin\%BUILD_TYPE%\blender.exe"
 echo.
@@ -287,8 +314,10 @@ goto EOF
                echo.
                echo Configuration options
                echo - with_tests ^(enable building unit tests^)
+               echo - noge ^(disable building game enginge and player^)
                echo - debug ^(Build an unoptimized debuggable build^)
                echo - packagename [newname] ^(override default cpack package name^)
+               echo - buildir [newdir] ^(override default build folder^)
                echo - x86 ^(override host auto-detect and build 32 bit code^)
                echo - x64 ^(override host auto-detect and build 64 bit code^)
                echo - 2013 ^(build with visual studio 2013^)