]> Creatis software - creaToolsTools.git/blob - Install_ThirdParty/scripts/install_thirdparty_all.bat
1d942818c2c8bf7856d876931077e466a9da5f0b
[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-4.7.3
57 set wxWidgets=wxWidgets-2.9.2
58 set boost=Boost-1.47.0
59 set xercesc=xerces-c-3.1.1
60 set itk=InsightToolkit-3.20.0
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 echo -----------------------------------
105 echo -------Creating Folders------------
106 echo -----------------------------------
107
108
109
110 rmdir %binpath% /s /q
111
112 rmdir %thirdpartyGeneration% /s /q
113 mkdir %thirdpartyGeneration%
114 cd  %thirdpartyGeneration%
115 mkdir thirdparty_source
116 mkdir thirdparty_bin
117 mkdir thirdparty_install
118
119
120 echo ------End Creating Folders---------
121
122 echo -----------------------------------
123 echo ------Downloading Sources----------
124 echo -----------------------------------
125
126 cd %thirdpartyGeneration%\thirdparty_source\
127 %wgetPath% %urlCreatisSource%/qt-4.7.3.zip
128 %wgetPath% %urlCreatisSource%/wxWidgets-2.9.2.7z
129 %wgetPath% %urlCreatisSource%/boost_1_47_0.7z
130 %wgetPath% %urlCreatisSource%/vtk-5.8.0.tar.gz
131 %wgetPath% %urlCreatisSource%/InsightToolkit-3.20.0.zip
132 %wgetPath% %urlCreatisSource%/gdcm_11_Oct_2011.tar.gz
133 %wgetPath% %urlCreatisSource%/xerces-c-3.1.1.zip
134 %wgetPath% %urlCreatisSource%/tth_exe.zip
135 echo ------End Downloading Sources------
136
137 echo -----------------------------------
138 echo --------Qt Installation------------
139 echo -----------------------------------
140 echo ----------Extracting---------------
141
142 cd %sourcepath%
143 %zipPath% x %sourcepath%\qt-4.7.3.zip
144 del %sourcepath%\qt-4.7.3.zip
145
146 echo --------Renaming Folder------------
147
148 rename qt-everywhere-opensource-src-4.7.3 %qt%
149
150 echo ----------Installing---------------
151
152
153 cd %QTDIR%
154
155
156 if %PROCESSOR_ARCHITECTURE%==x86 (
157 echo y | configure -%buildType% -opensource -shared -qt-sql-sqlite -phonon -phonon-backend -platform win32-msvc2010 -mp
158 ) else (
159 echo y | configure -%buildType% -opensource -shared -qt-sql-sqlite -phonon -phonon-backend -platform win32-msvc2010 -mp
160 )
161
162 nmake
163 cd C:\
164
165 echo ------End QT Installation----------
166
167 echo -----------------------------------
168 echo -----wxWidgets Installation--------
169 echo -----------------------------------
170 echo ----------Extracting---------------
171
172 cd %sourcepath%
173 md %wxWidgets%
174 cd %wxWidgets%
175 %zipPath% x %sourcepath%\wxWidgets-2.9.2.7z
176 del %sourcepath%\wxWidgets-2.9.2.7z
177
178 echo ----------Installing---------------
179
180 cd %sourcepath%\%wxWidgets%\build\msw
181 nmake -f makefile.vc BUILD=%buildType% UNICODE=1 SHARED=1
182 cd C:\
183
184 echo ----End wxWidgets Installation-----
185
186 echo -----------------------------------
187 echo ------Boost Installation-----------
188 echo -----------------------------------
189 echo ----------Extracting---------------
190
191 cd %sourcepath%
192 %zipPath% x %thirdpartyGeneration%\thirdparty_source\boost_1_47_0.7z
193 del %thirdpartyGeneration%\thirdparty_source\boost_1_47_0.7z
194
195 echo --------Renaming Folder------------
196
197 rename boost_1_47_0 %boost%
198
199 echo ----------Installing---------------
200
201 cd %sourcepath%\%boost%
202 call bootstrap.bat
203
204 if %PROCESSOR_ARCHITECTURE%==x86 (
205
206   b2.exe --toolset=msvc-10.0 --build-type=complete stage
207
208 ) else (
209
210 cd stage
211   b2.exe --toolset=msvc-10.0 --build-type=complete architecture=x86 address-model=64 stage
212
213 )
214
215 cd C:\
216
217 echo -----End Boost Installation--------
218
219 echo -----------------------------------
220 echo -------ITK Installation------------
221 echo -----------------------------------
222 echo ----------Extracting---------------
223
224 cd %sourcepath%
225 %zipPath% x InsightToolkit-3.20.0.zip
226 del InsightToolkit-3.20.0.zip
227
228 echo ----------Installing---------------
229
230 cd  %binpath%
231 echo mkdir %itk%Bin
232 cd %itk%Bin
233 cmake -G"Visual Studio 10" -H%sourcepath%\%itk% -B%binpath%\%itk%Bin 
234 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
235 cmake -D USE_DEBUG_LIB:BOOL=%buildType% CMakeCache.txt
236 cmake CMakeCache.txt
237 FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%buildType%
238 msbuild /p:Configuration=%buildType% INSTALL.vcxproj
239 cd c:\
240
241 echo ------End ITK Installation---------
242
243 echo -----------------------------------
244 echo ------XERCES Installation----------
245 echo -----------------------------------
246 echo ----------Extracting---------------
247
248 cd %sourcepath%
249 %zipPath% x xerces-c-3.1.1.zip
250 del xerces-c-3.1.1.zip
251
252 echo ----------Installing---------------
253
254 cd  %sourcepath%\%xercesc%\projects\Win32\VC10\xerces-all
255 FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=build
256 FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%buildType%
257 msbuild /p:Configuration=%buildType% INSTALL.vcxproj
258
259 echo -----End XERCES Installation-------
260
261 echo -----------------------------------
262 echo -------VTK Installation------------
263 echo -----------------------------------
264 echo ----------Extracting---------------
265
266 cd %sourcepath%
267 %zipPath% x %thirdpartyGeneration%\thirdparty_source\VTK-5.8.0.tar.gz
268 %zipPath% x %thirdpartyGeneration%\thirdparty_source\VTK-5.8.0.tar
269 cd %thirdpartyGeneration%\thirdparty_source\VTK
270 del %thirdpartyGeneration%\thirdparty_source\VTK-5.8.0.tar.gz
271 del %thirdpartyGeneration%\thirdparty_source\VTK-5.8.0.tar
272
273 echo ----------Installing---------------
274
275
276 cd  %binpath%
277 mkdir %vtk%Bin
278 cd %vtk%Bin
279 cmake -G"Visual Studio 10"  -H%sourcepath%\%vtk% -B%binpath%\%vtk%Bin 
280 cmake -D USE_DEBUG_LIB:BOOL=%buildType% -D CMAKE_INSTALL_PREFIX:PATH=%installpath%\%vtk%\ CMakeCache.txt
281 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
282 cmake CMakeCache.txt
283 FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%buildType%
284 msbuild /p:Configuration=%buildType% INSTALL.vcxproj
285 cd c:\
286 echo ------End VTK Installation---------
287
288 echo -----------------------------------
289 echo -------GDCM Installation-----------
290 echo -----------------------------------
291 echo ----------Extracting---------------
292
293 cd %sourcepath%
294 %zipPath% x gdcm_11_Oct_2011.tar.gz
295 %zipPath% x gdcm_11_Oct_2011.tar
296 del gdcm_11_Oct_2011.tar.gz
297 del gdcm_11_Oct_2011.tar
298
299 echo ----------Installing---------------
300
301
302 cd  %binpath%
303 mkdir %gdcm%Bin
304
305 cd %gdcm%Bin
306 cmake -G"Visual Studio 10"  -H%sourcepath%\%gdcm% -B%binpath%\%gdcm%Bin
307 cmake -D USE_DEBUG_LIB:BOOL=%buildType% -D CMAKE_INSTALL_PREFIX:PATH=%installpath%\%gdcm%\ CMakeCache.txt
308 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
309 cmake CMakeCache.txt
310 FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%buildType%
311 msbuild /p:Configuration=%buildType% INSTALL.vcxproj
312 cd c:\
313
314 echo -----End GDCM Installation---------
315
316 echo -----------------------------------
317 echo -------TTH Installation------------
318 echo -----------------------------------
319 echo ----------Extracting---------------
320 cd %sourcepath%
321 %zipPath% x tth_exe.zip
322 rename tth_exe tth
323 del tth_exe.zip
324 echo ------End TTH Installation---------
325 cd c:\
326 @echo on