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