-
Notifications
You must be signed in to change notification settings - Fork 2
/
make.bat
136 lines (117 loc) · 3.11 KB
/
make.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
@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.
set BLENDER_DIR=%~dp0
set BUILD_DIR=%BLENDER_DIR%..\build_windows
set BUILD_TYPE=Release
set BUILD_CMAKE_ARGS=
REM Sanity Checks
where /Q msbuild
if %ERRORLEVEL% NEQ 0 (
echo Error: "MSBuild" command not in the PATH.
echo You must have MSVC installed and run this from the "Developer Command Prompt"
echo ^(available from Visual Studio's Start menu entry^), aborting!
goto EOF
)
where /Q cmake
if %ERRORLEVEL% NEQ 0 (
echo Error: "CMake" command not in the PATH.
echo You must have CMake installed and added to your PATH, aborting!
goto EOF
)
if NOT EXIST %BLENDER_DIR%..\lib\nul (
echo Error: Path to libraries not found "%BLENDER_DIR%..\lib\"
echo This is needed for building, aborting!
goto EOF
)
:argv_loop
if NOT "%1" == "" (
REM Help Message
if "%1" == "--help" (
echo.
echo Convenience targets
echo - debug
echo - full
echo - lite
echo - headless
echo - cycles
echo - bpy
echo.
echo Utilities ^(not associated with building^)
echo - update
goto EOF
)
REM Build Types
if "%1" == "debug" (
set BUILD_DIR=%BUILD_DIR%_debug
set BUILD_TYPE=Debug
REM Build Configurations
) else if "%1" == "full" (
set BUILD_DIR=%BUILD_DIR%_full
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% ^
-C"%BLENDER_DIR%\build_files\cmake\config\blender_full.cmake"
) else if "%1" == "lite" (
set BUILD_DIR=%BUILD_DIR%_lite
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% ^
-C"%BLENDER_DIR%\build_files\cmake\config\blender_lite.cmake"
) else if "%1" == "cycles" (
set BUILD_DIR=%BUILD_DIR%_cycles
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% ^
-C"%BLENDER_DIR%\build_files\cmake\config\cycles_standalone.cmake"
) else if "%1" == "headless" (
set BUILD_DIR=%BUILD_DIR%_headless
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% ^
-C"%BLENDER_DIR%\build_files\cmake\config\blender_headless.cmake"
) else if "%1" == "bpy" (
set BUILD_DIR=%BUILD_DIR%_bpy
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% ^
-C"%BLENDER_DIR%\build_files\cmake\config\bpy_module.cmake"
REM Non-Build Commands
) else if "%1" == "update" (
svn up ../lib/*
git pull --rebase
git submodule foreach git pull --rebase origin master
goto EOF
) else (
echo Command "%1" unknown, aborting!
goto EOF
)
shift /1
goto argv_loop
)
if "%PROCESSOR_ARCHITECTURE%" == "x86" (
set WINDOWS_ARCH=
) else (
set WINDOWS_ARCH=Win64
)
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio 12 2013 %WINDOWS_ARCH%"
if NOT EXIST %BUILD_DIR%\nul (
mkdir %BUILD_DIR%
)
cmake ^
%BUILD_CMAKE_ARGS% ^
-H%BLENDER_DIR% ^
-B%BUILD_DIR% ^
%BUILD_CMAKE_ARGS%
if %ERRORLEVEL% NEQ 0 (
echo "Configuration Failed"
goto EOF
)
msbuild ^
%BUILD_DIR%\Blender.sln ^
/target:build ^
/property:Configuration=%BUILD_TYPE% ^
/maxcpucount ^
/verbosity:minimal
if %ERRORLEVEL% NEQ 0 (
echo "Build Failed"
goto EOF
)
msbuild ^
%BUILD_DIR%\INSTALL.vcxproj ^
/property:Configuration=%BUILD_TYPE% ^
/verbosity:minimal
echo.
echo Your build is complete at: "%BUILD_DIR%\bin\%BUILD_TYPE%"
echo.
:EOF