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