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