]> Creatis software - creaToolsTools.git/blob - Install_ThirdParty/scripts/install_thirdparty_all.bat
ca4fd01fdf1b7004c88b5de4810935a84fe34861
[creaToolsTools.git] / Install_ThirdParty / scripts / install_thirdparty_all.bat
1 @echo off
2 echo -----------------------------------
3 echo ------Asking Architecture----------
4 echo -----------------------------------
5 if %PROCESSOR_ARCHITECTURE%==x86 (
6   set ProgramFilesPath_x86=%ProgramFiles%
7   echo "Architecture found = x86"
8 ) else (
9   set "ProgramFilesPath_x64=%ProgramFiles%"
10   set "ProgramFilesPath_x86=%ProgramFiles(x86)%"
11   echo "Architecture found = x64"
12 )
13
14 echo ----End Asking Architecture--------
15
16 echo -----------------------------------
17 echo ---Setting Environment Variables----
18 echo -----------------------------------
19
20 set thirdpartyGeneration=%1
21 set buildType=%2
22
23 set urlCreatisSource=http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source
24 set urlCreatisSource=http://www.creatis.insa-lyon.fr/~caceres/software
25
26 set zipPath="%ProgramFilesPath_x86%\7-Zip\7z.exe"
27 set "miktex=%ProgramFiles(x86)%\MiKTeX 2.9"
28 set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
29 set wgetPath=%cd%\..\..\windows\creaTools_win_installers\CreaTools_v2_0_0_win32_installer\bin\wget.exe
30
31 if not exist %zipPath% set zipPath="%ProgramFilesPath_x64%\7-Zip\7z.exe"
32 if not exist %zipPath% (
33   echo ERROR!!! 7Zip has not been found in the system
34   exit
35 )
36 if not exist %vcvarsall% set zipPath="%ProgramFilesPath_x64%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
37 if not exist %vcvarsall% (
38   echo ERROR!!! Visual Studio has not been found in the system
39   exit
40 )
41 if "%miktex%"=="\MiKTeX 2.9" set "miktex=%ProgramFiles%\MiKTeX 2.9"
42 if "%miktex%"=="\MiKTeX 2.9" (
43   echo ERROR!!! MiKTex has not been found in the system
44   exit
45 )
46 if not exist %wgetPath% (
47   echo ERROR!!! wget has not been found in the system
48   exit
49 )
50
51
52 set installpath=%thirdpartyGeneration%\thirdparty_install
53 set binpath=%thirdpartyGeneration%\thirdparty_bin
54 set sourcepath=%thirdpartyGeneration%\thirdparty_source
55
56 set qt=Qt
57 set wxWidgets=wxWidgets
58 set boost=Boost
59 set xercesc=xerces
60 set itk=ITK
61 set gdcm=gdcm
62 set vtk=VTK
63
64 set QTDIR=%sourcepath%\%qt%
65 set WXDIR=%sourcepath%\%wxWidgets%
66 set BOOSTDIR=%sourcepath%\%boost%
67 set XERCESDIR=%sourcepath%\%xercesc%
68 set ITKSRCDIR=%sourcepath%\%itk%
69 set VTKSRCDIR=%sourcepath%\%VTK%
70 set GDCMSRCDIR=%sourcepath%\%gdcm%
71
72 echo -----------------------------------
73 echo Environment variables Configuration
74 echo -----------------------------------
75 echo %thirdpartyGeneration%
76 echo %buildType%
77 echo %wgetPath%
78 echo %urlCreatisSource%
79 echo %zipPath%
80 echo %vcvarsall%
81 echo %installpath%
82 echo %binpath%
83 echo %sourcepath%
84 echo %qt%
85 echo %wxWidgets%
86 echo %boost%
87 echo %xercesc%
88 echo %itk%
89 echo %gdcm%
90 echo %vtk%
91 echo %QTDIR%
92 echo %WXDIR%
93 echo %BOOSTDIR%
94 echo %XERCESDIR%
95 echo %ITKSRCDIR%
96 echo %VTKSRCDIR%
97 echo %GDCMSRCDIR%
98
99 echo ---End Setting Global Variables----
100 echo -----------------------------------
101
102
103 call %vcvarsall%
104
105 echo -----------------------------------
106 echo -------Creating Folders------------
107 echo -----------------------------------
108
109
110
111 rmdir %binpath% /s /q
112
113 rmdir %thirdpartyGeneration% /s /q
114 mkdir %thirdpartyGeneration%
115 cd  %thirdpartyGeneration%
116 mkdir thirdparty_source
117 mkdir thirdparty_bin
118 mkdir thirdparty_install
119
120
121 echo ------End Creating Folders---------
122
123 echo -----------------------------------
124 echo ------Downloading Sources----------
125 echo -----------------------------------
126
127 cd %thirdpartyGeneration%\thirdparty_source\
128 %wgetPath% %urlCreatisSource%/qt-4.7.3.zip
129 %wgetPath% %urlCreatisSource%/wxWidgets-2.9.2.7z
130 %wgetPath% %urlCreatisSource%/boost_1_47_0.7z
131 %wgetPath% %urlCreatisSource%/vtk-5.8.0.tar.gz
132 %wgetPath% %urlCreatisSource%/InsightToolkit-3.20.0.zip
133 %wgetPath% %urlCreatisSource%/gdcm_11_Oct_2011.tar.gz
134 %wgetPath% %urlCreatisSource%/xerces-c-3.1.1.zip
135 %wgetPath% %urlCreatisSource%/tth_exe.zip
136 echo ------End Downloading Sources------
137
138 echo -----------------------------------
139 echo --------Qt Installation------------
140 echo -----------------------------------
141 echo ----------Extracting---------------
142
143 cd %sourcepath%
144 %zipPath% x %sourcepath%\qt-4.7.3.zip
145 del %sourcepath%\qt-4.7.3.zip
146
147 echo --------Renaming Folder------------
148
149 rename qt-everywhere-opensource-src-4.7.3 %qt%
150
151 echo ----------Installing---------------
152
153
154 cd %QTDIR%
155
156
157 if %PROCESSOR_ARCHITECTURE%==x86 (
158 echo y | configure -%buildType% -opensource -shared -qt-sql-sqlite -phonon -phonon-backend -platform win32-msvc2010 -mp
159 ) else (
160 echo y | configure -%buildType% -opensource -shared -qt-sql-sqlite -phonon -phonon-backend -platform win32-msvc2010 -mp
161 )
162
163 nmake
164 cd C:\
165
166 echo ------End QT Installation----------
167
168 echo -----------------------------------
169 echo -----wxWidgets Installation--------
170 echo -----------------------------------
171 echo ----------Extracting---------------
172
173 cd %sourcepath%
174 md %wxWidgets%
175 cd %wxWidgets%
176 %zipPath% x %sourcepath%\wxWidgets-2.9.2.7z
177 del %sourcepath%\wxWidgets-2.9.2.7z
178
179 echo ----------Installing---------------
180
181 cd %sourcepath%\%wxWidgets%\build\msw
182 nmake -f makefile.vc BUILD=%buildType% UNICODE=1 SHARED=1
183 cd C:\
184
185 echo ----End wxWidgets Installation-----
186
187 echo -----------------------------------
188 echo ------Boost Installation-----------
189 echo -----------------------------------
190 echo ----------Extracting---------------
191
192 cd %sourcepath%
193 %zipPath% x %thirdpartyGeneration%\thirdparty_source\boost_1_47_0.7z
194 del %thirdpartyGeneration%\thirdparty_source\boost_1_47_0.7z
195
196 echo --------Renaming Folder------------
197
198 rename boost_1_47_0 %boost%
199
200 echo ----------Installing---------------
201
202 cd %sourcepath%\%boost%
203 call bootstrap.bat
204
205 if %PROCESSOR_ARCHITECTURE%==x86 (
206
207   b2.exe --toolset=msvc-10.0 --build-type=complete stage
208
209 ) else (
210
211 cd stage
212   b2.exe --toolset=msvc-10.0 --build-type=complete architecture=x86 address-model=64 stage
213
214 )
215
216 cd C:\
217
218 echo -----End Boost Installation--------
219
220 echo -----------------------------------
221 echo -------ITK Installation------------
222 echo -----------------------------------
223 echo ----------Extracting---------------
224
225 cd %sourcepath%
226 %zipPath% x InsightToolkit-3.20.0.zip
227 del InsightToolkit-3.20.0.zip
228
229 echo ----------Installing---------------
230
231 cd  %binpath%
232 mkdir %itk%Bin
233 cd %itk%Bin
234 cmake -G"Visual Studio 10" -H%sourcepath%\%itk% -B%binpath%\%itk%Bin 
235 cmake -D CMAKE_INSTALL_PREFIX:PATH=%installpath%\%itk%\ -D BUILD_EXAMPLES:BOOL=OFF -D BUILD_TESTING:BOOL=OFF -D BUILD_SHARED_LIBS:BOOL=ON -D ITK_USE_REVIEW:BOOL=ON CMakeCache.txt
236 cmake -D USE_DEBUG_LIB:BOOL=%buildType% CMakeCache.txt
237 cmake CMakeCache.txt
238 FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%buildType%
239 msbuild /p:Configuration=%buildType% INSTALL.vcxproj
240 cd c:\
241
242 echo ------End ITK Installation---------
243
244 echo -----------------------------------
245 echo ------XERCES Installation----------
246 echo -----------------------------------
247 echo ----------Extracting---------------
248
249 cd %sourcepath%
250 %zipPath% x xerces-c-3.1.1.zip
251 del xerces-c-3.1.1.zip
252
253 echo ----------Installing---------------
254
255 cd  %sourcepath%\%xercesc%\projects\Win32\VC10\xerces-all
256 FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=build
257 FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%buildType%
258 msbuild /p:Configuration=%buildType% INSTALL.vcxproj
259
260 echo -----End XERCES Installation-------
261
262
263
264 echo -----------------------------------
265 echo -------VTK Installation------------
266 echo -----------------------------------
267 echo ----------Extracting---------------
268
269 cd %sourcepath%
270 %zipPath% x %thirdpartyGeneration%\thirdparty_source\VTK-5.8.0.tar.gz
271 %zipPath% x %thirdpartyGeneration%\thirdparty_source\VTK-5.8.0.tar
272 cd %thirdpartyGeneration%\thirdparty_source\VTK
273 del %thirdpartyGeneration%\thirdparty_source\VTK-5.8.0.tar.gz
274 del %thirdpartyGeneration%\thirdparty_source\VTK-5.8.0.tar
275
276 echo ----------Installing---------------
277
278 cd  %binpath%
279 mkdir %vtk%Bin
280 cd %vtk%Bin
281 cmake -G"Visual Studio 10"  -H%sourcepath%\%vtk% -B%binpath%\%vtk%Bin 
282 cmake -D USE_DEBUG_LIB:BOOL=%buildType% -D CMAKE_INSTALL_PREFIX:PATH=%installpath%\%vtk%\ CMakeCache.txt
283 cmake -D BUILD_EXAMPLES:BOOL=OFF -D BUILD_TESTING:BOOL=OFF -D BUILD_SHARED_LIBS:BOOL=ON -D VTK_USE_QT:BOOL=ON CMakeCache.txt
284 cmake CMakeCache.txt
285 FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%buildType%
286 msbuild /p:Configuration=%buildType% INSTALL.vcxproj
287 cd c:\
288
289 echo ------End VTK Installation---------
290
291 echo -----------------------------------
292 echo -------GDCM Installation-----------
293 echo -----------------------------------
294 echo ----------Extracting---------------
295
296 cd %sourcepath%
297 %zipPath% x gdcm_11_Oct_2011.tar.gz
298 %zipPath% x gdcm_11_Oct_2011.tar
299 del gdcm_11_Oct_2011.tar.gz
300 del gdcm_11_Oct_2011.tar
301
302 echo ----------Installing---------------
303
304
305 cd  %binpath%
306 mkdir %gdcm%Bin
307
308 cd %gdcm%Bin
309 cmake -G"Visual Studio 10"  -H%sourcepath%\%gdcm% -B%binpath%\%gdcm%Bin
310 cmake -D USE_DEBUG_LIB:BOOL=%buildType% -D CMAKE_INSTALL_PREFIX:PATH=%installpath%\%gdcm%\ CMakeCache.txt
311 cmake -D VTK_DIR:PATH=%binpath%\%vtk%Bin -D GDCM_VTK:BOOL=ON -D BUILD_TESTING:BOOL=OFF -D GDCM_NAME_SPACE:STRING=gdcm13 CMakeCache.txt
312 cmake CMakeCache.txt
313 FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%buildType%
314 msbuild /p:Configuration=%buildType% INSTALL.vcxproj
315 cd c:\
316
317 echo -----End GDCM Installation---------
318
319 echo -----------------------------------
320 echo -------TTH Installation------------
321 echo -----------------------------------
322 echo ----------Extracting---------------
323 %zipPath% x tth_exe.zip
324 rename tth_exe tth
325 del tth_exe.zip
326 echo ------End TTH Installation---------
327
328 cd c:\
329 @echo on