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