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