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