30bd2ebdcd2157fc55654c3d6cf5d77ef2b40d86
[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" == "clang" (
40                 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS%
41                 set WITH_CLANG=1
42         ) else if "%1" == "release" (
43                 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_release.cmake"
44                 set TARGET=Release
45         ) else if "%1" == "asan" (
46                 set WITH_ASAN=1
47         ) else if "%1" == "x86" (
48                 set BUILD_ARCH=x86
49         ) else if "%1" == "x64" (
50                 set BUILD_ARCH=x64
51         ) else if "%1" == "2017" (
52                 set BUILD_VS_YEAR=2017
53         ) else if "%1" == "2017pre" (
54                 set BUILD_VS_YEAR=2017
55                 set VSWHERE_ARGS=-prerelease
56                 set BUILD_VS_YEAR=2017
57         ) else if "%1" == "2017b" (
58                 set BUILD_VS_YEAR=2017
59                 set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
60         ) else if "%1" == "2015" (
61                 set BUILD_VS_YEAR=2015
62         ) else if "%1" == "packagename" (
63                 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DCPACK_OVERRIDE_PACKAGENAME="%2"
64                 shift /1
65         ) else if "%1" == "nobuild" (
66                 set NOBUILD=1
67         ) else if "%1" == "pydebug" (
68                 set WITH_PYDEBUG=1
69         ) else if "%1" == "showhash" (
70                 SET BUILD_SHOW_HASHES=1
71         REM Non-Build Commands
72         ) else if "%1" == "update" (
73                 SET BUILD_UPDATE=1
74         ) else if "%1" == "ninja" (
75                 SET BUILD_WITH_NINJA=1
76         ) else if "%1" == "clean" (
77                 set MUST_CLEAN=1
78         ) else if "%1" == "verbose" (
79                 set VERBOSE=1
80         ) else (
81                 echo Command "%1" unknown, aborting!
82                 exit /b 1
83         )
84         shift /1
85         goto argv_loop
86 )
87 :EOF
88 exit /b 0