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