-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_all.bat
148 lines (107 loc) · 4.25 KB
/
build_all.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
136
137
138
139
140
141
142
143
144
145
146
147
148
::
:: To build a specific library add it as the argument to this script.
:: The matching label will be used:
:: Example:
:: build_all assimp
::
:: Not that there might be dependencies between the libraries.
@echo off
set A_CURR_DIR=%~d0%~p0
IF not errorlevel 0 goto error
IF NOT EXIST "%A_CURR_DIR%dependencies" (
echo.
echo.
echo *** %A_CURR_DIR%dependencies is missing. Please download and unzip to that directory before running this script again
goto error
)
set LABEL=%1
mkdir "%A_CURR_DIR%\installed\include\rapidxml\"
copy "%A_CURR_DIR%\dependencies\rapidxml-1.13\*.hpp" "%A_CURR_DIR%\installed\include\rapidxml\"
copy "%A_CURR_DIR%\dependencies\stb\*.h" "%A_CURR_DIR%\installed\include"
if NOT "%LABEL%"=="" goto %1
IF "%CMAKE_GENERATOR_VERSION%"=="" (
echo *** setup_env.bat has not been setup correctly
goto error
)
:: Build glfw
:glfw
mkdir "%A_CURR_DIR%\build"
mkdir "%A_CURR_DIR%\build\glfw"
pushd "%A_CURR_DIR%\build\glfw"
IF not errorlevel 0 goto error
cmake -G "%CMAKE_GENERATOR_VERSION%" -A %BUILD_ARCHITECHTURE% -DCMAKE_INSTALL_PREFIX="%A_CURR_DIR%\installed" -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF -DBUILD_SHARED_LIBS=OFF "%A_CURR_DIR%\dependencies\glfw-3.3.9"
IF not errorlevel 0 goto error
call "%A_CURR_DIR%\build" glfw.sln /release /WIN64
IF not errorlevel 0 goto error
call "%A_CURR_DIR%\build" glfw.sln /release /WIN64 /INSTALL
IF not errorlevel 0 goto error
popd
IF NOT "%LABEL%"=="" goto exit
:glm
mkdir "%A_CURR_DIR%\build"
mkdir "%A_CURR_DIR%\build\glm"
pushd "%A_CURR_DIR%\build\glm"
IF not errorlevel 0 goto error
cmake -G "%CMAKE_GENERATOR_VERSION%" -A %BUILD_ARCHITECHTURE% -DCMAKE_INSTALL_PREFIX="%A_CURR_DIR%\installed" "%A_CURR_DIR%\dependencies\glm"
IF not errorlevel 0 goto error
call "%A_CURR_DIR%\build" glm.sln /release /WIN64
IF not errorlevel 0 goto error
call "%A_CURR_DIR%\build" glm.sln /release /WIN64 /INSTALL
IF not errorlevel 0 goto error
popd
IF NOT "%LABEL%"=="" goto exit
:: ZLIB
:zlib
mkdir "%A_CURR_DIR%\build"
mkdir "%A_CURR_DIR%\build\zlib"
pushd "%A_CURR_DIR%\build\zlib"
IF not errorlevel 0 goto error
cmake -G "%CMAKE_GENERATOR_VERSION%" -A %BUILD_ARCHITECHTURE% -DCMAKE_INSTALL_PREFIX="%A_CURR_DIR%\installed" "%A_CURR_DIR%\dependencies\zlib-1.2.11"
IF not errorlevel 0 goto error
call "%A_CURR_DIR%\build" zlib.sln /release /WIN64
IF not errorlevel 0 goto error
call "%A_CURR_DIR%\build" zlib.sln /release /WIN64 /INSTALL
IF not errorlevel 0 goto error
popd
IF NOT "%LABEL%"=="" goto exit
:assimp
mkdir "%A_CURR_DIR%\build"
mkdir "%A_CURR_DIR%\build\assimp"
pushd "%A_CURR_DIR%\build\assimp"
IF not errorlevel 0 goto error
cmake -G "%CMAKE_GENERATOR_VERSION%" -A %BUILD_ARCHITECHTURE% -DCMAKE_CXX_FLAGS=/EHsc -DASSIMP_BUILD_NO_XFILE_EXPORTER=1 -DASSIMP_BUILD_TESTS=OFF -DASSIMP_BUILD_ASSIMP_TOOLS=off -DASSIMP_BUILD_X_IMPORTER=off -DCMAKE_INSTALL_PREFIX="%A_CURR_DIR%\installed" -DZLIB_INCLUDE_DIR="%A_CURR_DIR%\installed\include" "%A_CURR_DIR%\dependencies\assimp-5.3.1"
IF not errorlevel 0 goto error
call "%A_CURR_DIR%\build" assimp.sln /release /WIN64
IF not errorlevel 0 goto error
call "%A_CURR_DIR%\build" assimp.sln /release /WIN64 /INSTALL
IF not errorlevel 0 goto error
popd
IF NOT "%LABEL%"=="" goto exit
:freetype
mkdir "%A_CURR_DIR%\build"
mkdir "%A_CURR_DIR%\build\freetype-2.3.11"
pushd "%A_CURR_DIR%\build\freetype-2.3.11"
IF not errorlevel 0 goto error
cmake -G "%CMAKE_GENERATOR_VERSION%" -A %BUILD_ARCHITECHTURE% -DCMAKE_INSTALL_PREFIX="%A_CURR_DIR%\installed" "%A_CURR_DIR%\dependencies\freetype-2.3.11"
IF not errorlevel 0 goto error
call "%A_CURR_DIR%\build" freetype.sln /release /WIN64
IF not errorlevel 0 goto error
call "%A_CURR_DIR%\build" freetype.sln /release /WIN64 /INSTALL
IF not errorlevel 0 goto error
popd
IF NOT "%LABEL%"=="" goto exit
:vrlib
set FREETYPE_DIR="%A_CURR_DIR%"\installed\
cmake -G "%CMAKE_GENERATOR_VERSION%" -A %BUILD_ARCHITECHTURE% -DCMAKE_INSTALL_PREFIX="%A_CURR_DIR%\installed" -DZLIB_INCLUDE_DIR="%A_CURR_DIR%\installed\include" "%A_CURR_DIR%\"
IF not errorlevel 0 goto error
call "%A_CURR_DIR%\build" vrlib.sln /release /WIN64
IF not errorlevel 0 goto error
:install
call "%A_CURR_DIR%\build" vrlib.sln /release /WIN64 /INSTALL
IF not errorlevel 0 goto error
goto exit
:error
echo **** An error occurred
exit /b 1
:exit
exit /b 0