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