make.bat: refactor make.bat
[blender.git] / build_files / windows / parse_arguments.cmd
1 set BUILD_DIR=%BLENDER_DIR%..\build_windows
2 set BUILD_TYPE=Release
3 :argv_loop
4 if NOT "%1" == "" (
5
6         REM Help Message
7         if "%1" == "help" (
8                 set SHOW_HELP=1
9                 goto EOF
10         )
11         REM Build Types
12         if "%1" == "debug" (
13                 set BUILD_TYPE=Debug
14         REM Build Configurations
15         ) else if "%1" == "noge" (
16                 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_GAMEENGINE=OFF -DWITH_PLAYER=OFF
17                 set BUILD_NGE=_noge
18         ) else if "%1" == "builddir" (
19                 set BUILD_DIR_OVERRRIDE="%BLENDER_DIR%..\%2"
20                 shift /1
21         ) else if "%1" == "with_tests" (
22                 set TESTS_CMAKE_ARGS=-DWITH_GTESTS=On
23         ) else if "%1" == "full" (
24                 set TARGET=Full
25                 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% ^
26                     -C"%BLENDER_DIR%\build_files\cmake\config\blender_full.cmake"
27         ) else if "%1" == "lite" (
28                 set TARGET=Lite
29                 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_lite.cmake"
30         ) else if "%1" == "cycles" (
31                 set TARGET=Cycles
32                 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\cycles_standalone.cmake"
33         ) else if "%1" == "headless" (
34                 set TARGET=Headless
35                 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_headless.cmake"
36         ) else if "%1" == "bpy" (
37                 set TARGET=Bpy
38                 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\bpy_module.cmake"
39         ) else if "%1" == "release" (
40                 set TARGET=Release
41         ) else if "%1" == "x86" (
42                 set BUILD_ARCH=x86
43         ) else if "%1" == "x64" (
44                 set BUILD_ARCH=x64
45         ) else if "%1" == "2017" (
46                 set BUILD_VS_YEAR=2017
47         ) else if "%1" == "2017pre" (
48                 set BUILD_VS_YEAR=2017
49                 set VSWHERE_ARGS=-prerelease
50         ) else if "%1" == "2015" (
51                 set BUILD_VS_YEAR=2015
52         ) else if "%1" == "2013" (
53                 set BUILD_VS_YEAR=2013
54         ) else if "%1" == "packagename" (
55                 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DCPACK_OVERRIDE_PACKAGENAME="%2"
56                 shift /1
57         ) else if "%1" == "nobuild" (
58                 set NOBUILD=1
59         ) else if "%1" == "showhash" (
60                 SET BUILD_SHOW_HASHES=1
61         REM Non-Build Commands
62         ) else if "%1" == "update" (
63                 SET BUILD_UPDATE=1
64         ) else if "%1" == "ninja" (
65                 SET BUILD_WITH_NINJA=1
66         ) else if "%1" == "clean" (
67                 set MUST_CLEAN=1
68         ) else if "%1" == "verbose" (
69                 set VERBOSE=1
70         ) else (
71                 echo Command "%1" unknown, aborting!
72                 exit /b 1
73         )
74         shift /1
75         goto argv_loop
76 )
77 :EOF
78 exit /b 0