2 REM This batch file does an out-of-source CMake build in ../build_windows
3 REM This is for users who like to configure & build Blender with a single command.
4 setlocal EnableDelayedExpansion
5 setlocal ENABLEEXTENSIONS
8 call "%BLENDER_DIR%\build_files\windows\reset_variables.cmd"
10 call "%BLENDER_DIR%\build_files\windows\check_spaces_in_path.cmd"
11 if errorlevel 1 goto EOF
13 call "%BLENDER_DIR%\build_files\windows\parse_arguments.cmd" %*
14 if errorlevel 1 goto EOF
16 call "%BLENDER_DIR%\build_files\windows\find_dependencies.cmd"
17 if errorlevel 1 goto EOF
19 REM if it is one of the convenience targets and BLENDER_BIN is set
20 REM skip compiler detection
21 if "%ICONS%%ICONS_GEOM%%DOC_PY%" == "1" (
22 if EXIST "%BLENDER_BIN%" (
23 goto convenience_targets
27 if "%BUILD_SHOW_HASHES%" == "1" (
28 call "%BLENDER_DIR%\build_files\windows\show_hashes.cmd"
32 if "%SHOW_HELP%" == "1" (
33 call "%BLENDER_DIR%\build_files\windows\show_help.cmd"
37 if "%FORMAT%" == "1" (
38 call "%BLENDER_DIR%\build_files\windows\format.cmd"
42 call "%BLENDER_DIR%\build_files\windows\detect_architecture.cmd"
43 if errorlevel 1 goto EOF
45 if "%BUILD_VS_YEAR%" == "" (
46 call "%BLENDER_DIR%\build_files\windows\autodetect_msvc.cmd"
48 echo Visual Studio not found ^(try with the 'verbose' switch for more information^)
52 call "%BLENDER_DIR%\build_files\windows\detect_msvc%BUILD_VS_YEAR%.cmd"
54 echo Visual Studio %BUILD_VS_YEAR% not found ^(try with the 'verbose' switch for more information^)
59 if "%BUILD_UPDATE%" == "1" (
60 REM First see if the SVN libs are there and check them out if they are not.
61 call "%BLENDER_DIR%\build_files\windows\check_libraries.cmd"
62 if errorlevel 1 goto EOF
63 if "%BUILD_UPDATE_SVN%" == "1" (
64 REM Then update SVN platform libraries, since updating python while python is
65 REM running tends to be problematic. The python script that update_sources
66 REM calls later on may still try to switch branches and run into trouble,
67 REM but for *most* people this will side step the problem.
68 call "%BLENDER_DIR%\build_files\windows\lib_update.cmd"
70 REM Finally call the python script shared between all platforms that updates git
71 REM and does any other SVN work like update the tests or branch switches
73 call "%BLENDER_DIR%\build_files\windows\update_sources.cmd"
77 call "%BLENDER_DIR%\build_files\windows\set_build_dir.cmd"
82 call "%BLENDER_DIR%\build_files\windows\icons.cmd"
86 if "%ICONS_GEOM%" == "1" (
87 call "%BLENDER_DIR%\build_files\windows\icons_geom.cmd"
91 if "%DOC_PY%" == "1" (
92 call "%BLENDER_DIR%\build_files\windows\doc_py.cmd"
97 echo Cmake not found in path, required for building, exiting...
101 echo Building blender with VS%BUILD_VS_YEAR% for %BUILD_ARCH% in %BUILD_DIR%
103 call "%BLENDER_DIR%\build_files\windows\check_libraries.cmd"
104 if errorlevel 1 goto EOF
107 call "%BLENDER_DIR%\build_files\windows\test.cmd"
111 if "%BUILD_WITH_NINJA%" == "" (
112 call "%BLENDER_DIR%\build_files\windows\configure_msbuild.cmd"
113 if errorlevel 1 goto EOF
115 call "%BLENDER_DIR%\build_files\windows\build_msbuild.cmd"
116 if errorlevel 1 goto EOF
118 call "%BLENDER_DIR%\build_files\windows\configure_ninja.cmd"
119 if errorlevel 1 goto EOF
121 call "%BLENDER_DIR%\build_files\windows\build_ninja.cmd"
122 if errorlevel 1 goto EOF
126 if errorlevel 1 exit /b %errorlevel%