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