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