-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_win.bat
196 lines (142 loc) · 5.05 KB
/
build_win.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
:: Build script for rc_genicam_3dviewer under Windows
@echo off
setlocal enabledelayedexpansion
where nmake >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
echo This must be run in Visual Studio command prompt for x64
exit /b 1
)
where git >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
echo You must download and install git from: git-scm.com/download/win
exit /b 1
)
where cmake >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
echo You must download and install cmake from: https://cmake.org/download/
exit /b 1
)
:: Create directories building and installing
if not exist "build\" mkdir build
cd build
if not exist "install\" mkdir install
cd install
set INSTALL_PATH=%CD%
if not exist "bin\" mkdir bin
if not exist "include\" mkdir include
if not exist "include\GL\" mkdir include\GL
if not exist "lib" mkdir lib
set LIB=%LIB%;%INSTALL_PATH%\lib
cd ..\..\..
:: Clone all missing repositories
if not exist "FreeGLUT\" (
git clone https://github.com/dcnieho/FreeGLUT.git
cd FreeGLUT
git checkout 349a23dcc1264a76deb79962d1c90462ad0c6f50
cd ..
)
if not exist "glew-2.2.0\" (
echo You must download and unpack https://sourceforge.net/projects/glew/files/glew/2.2.0/glew-2.2.0-win32.zip/download
exit /b 1
)
if not exist "%INSTALL_PATH%\include\GL\glew.h" (
copy glew-2.2.0\include\GL\* %INSTALL_PATH%\include\GL
)
if not exist "%INSTALL_PATH%\bin\glew32.dll" (
copy glew-2.2.0\bin\Release\x64\glew32.dll %INSTALL_PATH%\bin
)
if not exist "%INSTALL_PATH%\lib\glew32.lib" (
copy glew-2.2.0\lib\Release\x64\glew32.lib %INSTALL_PATH%\lib
)
set OPT_GLEW=-DGLEW_INCLUDE_DIR="%CD%\glew-2.2.0\include" -DGLEW_SHARED_LIBRARY_RELEASE="%CD%\glew-2.2.0\lib\Release\x64\glew32.lib"
if not exist "cvkit\" (
git clone https://github.com/roboception/cvkit.git
)
if not exist "rc_genicam_api\" (
git clone https://github.com/roboception/rc_genicam_api.git
)
echo ----- Building FreeGLUT -----
cd FreeGLUT/freeglut/freeglut
if not exist "build\" mkdir build
cd build
if exist "build_rc_genicam_3dviewer\" (
cd build_rc_genicam_3dviewer\
) else (
mkdir build_rc_genicam_3dviewer\
cd build_rc_genicam_3dviewer\
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="%INSTALL_PATH%" ..\..
)
nmake install
if %ERRORLEVEL% NEQ 0 exit /b 1
copy "%INSTALL_PATH%\include\GL\freeglut.h" "%INSTALL_PATH%\include\GL\glut.h"
set OPT_GLUT=-DGLUT_INCLUDE_DIR="%INSTALL_PATH%\include" -DGLUT_glut_LIBRARY_RELEASE="%INSTALL_PATH%\lib\freeglut.lib"
cd ..\..\..\..\..
echo ----- Building cvkit -----
cd cvkit
if not exist "build\" mkdir build
cd build
if exist "build_rc_genicam_3dviewer\" (
cd build_rc_genicam_3dviewer\
) else (
mkdir build_rc_genicam_3dviewer\
cd build_rc_genicam_3dviewer\
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="%INSTALL_PATH%" %OPT_GLUT% %OPT_GLEW% ..\..
)
nmake install
if %ERRORLEVEL% NEQ 0 exit /b 1
cd ..\..\..
:: General options for all cmake packages
set OPT=-DUSE_SSE2=0 -DUSE_SSE4.2=0 -DUSE_AVX=0 -DUSE_AVX2=0 -DCMAKE_BUILD_TYPE=Release
echo ----- Building rc_genicam_api -----
cd rc_genicam_api
if not exist "build\" mkdir build
cd build
if exist "build_rc_genicam_3dviewer\" (
cd build_rc_genicam_3dviewer\
) else (
mkdir build_rc_genicam_3dviewer\
cd build_rc_genicam_3dviewer\
cmake -G "NMake Makefiles" %OPT% -DCMAKE_INSTALL_PREFIX="%INSTALL_PATH%" ..\..
)
nmake install
if %ERRORLEVEL% NEQ 0 exit /b 1
cd ..\..\..
echo ----- Building rc_genicam_3dviewer -----
cd rc_genicam_3dviewer\build
if exist "build_rc_genicam_3dviewer\" (
cd build_rc_genicam_3dviewer\
) else (
mkdir build_rc_genicam_3dviewer\
cd build_rc_genicam_3dviewer\
cmake -G "NMake Makefiles" %OPT% -DCMAKE_INSTALL_PREFIX="%INSTALL_PATH%" ..\..
)
nmake install
if %ERRORLEVEL% NEQ 0 exit /b 1
cd ..
echo ----- Extracting files for publication -----
for /F "tokens=* USEBACKQ" %%F in (`git describe`) do (set VERSION=%%F)
set TARGET=rc_genicam_3dviewer-%VERSION%-win64
if not exist "%TARGET%\" mkdir %TARGET%
copy %INSTALL_PATH%\bin\GCBase_*.dll %TARGET%
copy %INSTALL_PATH%\bin\GenApi_*.dll %TARGET%
copy %INSTALL_PATH%\bin\Log_*.dll %TARGET%
copy %INSTALL_PATH%\bin\log4cpp_*.dll %TARGET%
copy %INSTALL_PATH%\bin\MathParser_*.dll %TARGET%
copy %INSTALL_PATH%\bin\NodeMapData_*.dll %TARGET%
copy %INSTALL_PATH%\bin\XmlParser_*.dll %TARGET%
copy %INSTALL_PATH%\bin\msvcp140.dll %TARGET%
copy %INSTALL_PATH%\bin\vcruntime140.dll %TARGET%
copy %INSTALL_PATH%\bin\rc_genicam_api.dll %TARGET%
if not exist "%TARGET%\rc_genicam_api\" mkdir %TARGET%\rc_genicam_api
copy %INSTALL_PATH%\bin\bgapi2_gige.cti %TARGET%\rc_genicam_api
copy %INSTALL_PATH%\bin\bgapi2_usb.cti %TARGET%\rc_genicam_api
copy %INSTALL_PATH%\bin\bsysgige.xml %TARGET%\rc_genicam_api
copy %INSTALL_PATH%\bin\bsysusb.xml %TARGET%\rc_genicam_api
copy %INSTALL_PATH%\bin\gutil.dll %TARGET%
copy %INSTALL_PATH%\bin\bgui.dll %TARGET%
copy %INSTALL_PATH%\bin\gimage.dll %TARGET%
copy %INSTALL_PATH%\bin\gmath.dll %TARGET%
copy %INSTALL_PATH%\bin\gvr.dll %TARGET%
copy %INSTALL_PATH%\bin\freeglut.dll %TARGET%
copy %INSTALL_PATH%\bin\glew32.dll %TARGET%
copy %INSTALL_PATH%\bin\gc_3dviewer.exe %TARGET%