]> Creatis software - creaToolsTools.git/blob - Install_ThirdParty/scripts/download_ThirdPartySW.bat
DFCH: Update for x84 and x64 bit compilation
[creaToolsTools.git] / Install_ThirdParty / scripts / download_ThirdPartySW.bat
1 @echo off
2 echo -----------------------------------
3 echo --------Download Libraries---------
4 echo -----------------------------------
5
6 echo -----------------------------------
7 echo ---Setting Environment Variables---
8 echo -----------------------------------
9
10 set thirdpartyGeneration=%1
11 set buildType=%2
12 set wxStable=%3
13
14 set urlCreatisSource=http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source
15
16 if %PROCESSOR_ARCHITECTURE%==x86 (
17   set ProgramFilesPath_x86=%ProgramFiles%
18   echo "Architecture found = x86"
19 ) else (
20   set "ProgramFilesPath_x64=%ProgramFiles%"
21   set "ProgramFilesPath_x86=%ProgramFiles(x86)%"
22   echo "Architecture found = x64"
23 )
24
25 set zipPath="%ProgramFilesPath_x86%\7-Zip\7z.exe"
26 set miktex="%ProgramFilesPath_x86%\MiKTeX 2.9\miktex\bin\texworks.exe"
27 set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
28 set wgetPath="%ProgramFilesPath_x86%\GnuWin32\bin\wget.exe"
29
30 if not exist %zipPath% set zipPath="%ProgramFilesPath_x64%\7-Zip\7z.exe"
31 if not exist %zipPath% (
32   echo ERROR!!! 7Zip has not been found in the system
33   exit
34 )
35 if not exist %vcvarsall% set vcvarsall="%ProgramFilesPath_x64%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
36 if not exist %vcvarsall% (
37   echo ERROR!!! Visual Studio has not been found in the system
38   exit
39 )
40
41 if not exist %miktex% (
42  set miktex="%ProgramFilesPath_x64%\MiKTeX 2.9\miktex\bin\texworks.exe"
43  if not exist %miktex% (
44   echo ERROR!!! MiKTex has not been found in the system
45   exit
46  )
47 )
48
49 if not exist %wgetPath% (
50   echo ERROR!!! wget has not been found in the system
51   exit
52 )
53
54 set installpath=%thirdpartyGeneration%\thirdparty_install\%buildType%
55 set binpath=%thirdpartyGeneration%\thirdparty_bin\%buildType%
56 set sourcepath=%thirdpartyGeneration%\thirdparty_source\%buildType%
57
58 set QTFNAME=qt-everywhere-opensource-src-4.8.2.zip
59
60 if %wxStable%==ON (
61         set WXFNAME=wxWidgets-2.8.12.zip
62         set WXVERSION=2.8.12
63 ) else (
64         set WXFNAME=wxWidgets-2.9.3.zip
65         set WXVERSION=2.9.2
66 )
67 else
68 set BOOSTFNAME=boost_1_49_0.7z
69 set XERCESFNAME=xerces-c-3.1.1.zip
70 set ITKFNAME=InsightToolkit-3.20.1.zip
71 set VTKFNAME=vtk-5.10.0.zip
72 ::set GDCMFNAME=gdcm_11_Oct_2011.tar.gz
73 set GDCMFNAME=gdcm_05_Mai_2011.tar
74 set TTHFNAME=tth_exe.zip
75 set JOMFNAME=jom.zip
76
77 echo -----------------------------------
78 echo Environment variables Configuration
79 echo -----------------------------------
80 echo ThirdpartyGeneration=%thirdpartyGeneration%
81 echo BuildType=%buildType%
82 echo wget=%wgetPath%
83 echo MikTex=%miktex%
84 echo urlCreatis=%urlCreatisSource%
85 echo 7zip=%zipPath%
86 echo Visual Studio=%vcvarsall%
87 echo InstallPath=%installpath%
88 echo BinPath=%binpath%
89 echo SourcePath=%sourcepath%
90
91 echo -----------------------------------
92 echo -------Removing Folders------------
93 echo -----------------------------------
94
95 rmdir /S /Q %thirdpartyGeneration%
96
97 echo -----------------------------------
98 echo -------Creating Folders------------
99 echo -----------------------------------
100
101 mkdir %thirdpartyGeneration%
102 cd  %thirdpartyGeneration%
103 mkdir %sourcepath%
104 mkdir %binpath%
105 mkdir %installpath%
106
107 echo -----------------------------------
108 echo ------Downloading Sources----------
109 echo -----------------------------------
110
111 cd %sourcepath%\
112
113 %wgetPath% "http://releases.qt-project.org/qt4/source/%QTFNAME%"
114 %wgetPath% "http://sourceforge.net/projects/wxwindows/files/%WXVERSION%/%WXFNAME%/download"
115 %wgetPath% "http://sourceforge.net/projects/boost/files/boost/1.49.0/%BOOSTFNAME%/download"
116 %wgetPath% "http://mirror.ibcp.fr/pub/apache//xerces/c/3/sources/%XERCESFNAME%"
117 %wgetPath% "http://sourceforge.net/projects/itk/files/itk/3.20/%ITKFNAME%/download"
118 %wgetPath% "http://www.vtk.org/files/release/5.10/%VTKFNAME%"
119 %wgetPath% "%urlCreatisSource%/%GDCMFNAME%.gz"
120 %wgetPath% "http://hutchinson.belmont.ma.us/tth/tth-noncom/%TTHFNAME%"
121 %wgetPath% "ftp://ftp.qt.nokia.com/jom/%JOMFNAME%"
122
123 echo -----------------------------------
124 echo --------------Qt-------------------
125 echo -----------------------------------
126 call %vcvarsall%
127
128 cd %sourcepath%
129 %zipPath% x %sourcepath%\%QTFNAME%
130 del %sourcepath%\%QTFNAME%
131
132 echo -----------------------------------
133 echo --------------JOM------------------
134 echo -----------------------------------
135
136 cd %sourcepath%
137 %zipPath% x %sourcepath%\%JOMFNAME% -o*
138 del %sourcepath%\%JOMFNAME%
139
140 echo -----------------------------------
141 echo -----------wxWidgets---------------
142 echo -----------------------------------
143 echo ----------Extracting---------------
144
145 cd %sourcepath%
146 %zipPath% x %sourcepath%\%WXFNAME%
147   del %sourcepath%\%WXFNAME%
148
149 echo -----------------------------------
150 echo ------------Boost------------------
151 echo -----------------------------------
152
153 cd %sourcepath%
154 %zipPath% x %sourcepath%\%BOOSTFNAME%
155 del %sourcepath%\%BOOSTFNAME%
156
157 echo -----------------------------------
158 echo -------------VTK-------------------
159 echo -----------------------------------
160
161 cd %sourcepath%
162 %zipPath% x %sourcepath%\%VTKFNAME%
163 del %sourcepath%\%VTKFNAME%
164
165 echo -----------------------------------
166 echo -------------ITK-------------------
167 echo -----------------------------------
168
169 cd %sourcepath%
170 %zipPath% x %ITKFNAME%
171 del %ITKFNAME%
172
173 echo -----------------------------------
174 echo -------------XERCES----------------
175 echo -----------------------------------
176
177 cd %sourcepath%
178 %zipPath% x %XERCESFNAME%
179 del %XERCESFNAME%
180
181 echo -----------------------------------
182 echo ------------GDCM ------------------
183 echo -----------------------------------
184
185 cd %sourcepath%
186 %zipPath% x %GDCMFNAME%.gz
187 %zipPath% x %GDCMFNAME%
188 del %GDCMFNAME%.gz
189 del %GDCMFNAME%
190
191 echo -----------------------------------
192 echo --------------TTH------------------
193 echo -----------------------------------
194
195 cd %sourcepath%
196 %zipPath% x %TTHFNAME%
197 del %TTHFNAME%
198
199 echo ------End TTH Installation---------
200
201 echo -----------------------------------
202
203 echo -----------------------------------
204 echo --------Renaming Folders-----------
205 echo -----------------------------------
206 cd %sourcepath%
207 rename qt-everywhere-opensource-src-4.8.2 qt
208 rename wxWidgets-%WXVERSION% wxWidgets
209 rename boost_1_49_0 boost
210 rename InsightToolkit-3.20.1 itk
211 rename VTK vtk
212 rename gdcm gdcm
213 rename tth_exe tth
214 rename xerces-c-3.1.1 xerces
215
216 echo -----End of Download Libraries-----
217 echo -----------------------------------
218
219 exit /B