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