]> Creatis software - creaToolsTools.git/blob - Install_ThirdParty/scripts/download_ThirdPartySW.bat
b4a5842d94821a12452bc327d601b0570fea59a7
[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 set urlCreatisSource=http://www.creatis.insa-lyon.fr/~caceres/software
16
17 if %PROCESSOR_ARCHITECTURE%==x86 (
18   set ProgramFilesPath_x86=%ProgramFiles%
19   echo "Architecture found = x86"
20 ) else (
21   set "ProgramFilesPath_x64=%ProgramFiles%"
22   set "ProgramFilesPath_x86=%ProgramFiles(x86)%"
23   echo "Architecture found = x64"
24 )
25
26 set zipPath="%ProgramFilesPath_x86%\7-Zip\7z.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 %wgetPath% (
42   echo ERROR!!! wget has not been found in the system
43   exit
44 )
45
46 set installpath=%thirdpartyGeneration%\thirdparty_install\%buildType%
47 set binpath=%thirdpartyGeneration%\thirdparty_bin\%buildType%
48 set sourcepath=%thirdpartyGeneration%\thirdparty_source\%buildType%
49 set LogFolder=%thirdpartyGeneration%\installLog
50
51 set QTFNAME=qt-everywhere-opensource-src-4.8.2.zip
52
53 if %wxStable%==ON (
54         set WXFNAME=wxWidgets-2.8.12.zip
55         set WXVERSION=2.8.12
56 ) else (
57         set WXFNAME=wxWidgets-2.9.3.zip
58         set WXVERSION=2.9.2
59 )
60 else
61 set BOOSTFNAME=boost_1_49_0.7z
62 set XERCESFNAME=xerces-c-3.1.1.zip
63 set ITKFNAME=InsightToolkit-3.20.1.zip
64 set VTKFNAME=vtk-5.10.0.zip
65 set GDCMFNAME=gdcm_11_Oct_2011.tar
66 ::set GDCMFNAME=gdcm_05_Mai_2011.tar
67 set TTHFNAME=tth_exe.zip
68 set JOMFNAME=jom.zip
69
70 echo -----------------------------------
71 echo Environment variables Configuration
72 echo -----------------------------------
73 echo ThirdpartyGeneration=%thirdpartyGeneration%
74 echo BuildType=%buildType%
75 echo wget=%wgetPath%
76 echo urlCreatis=%urlCreatisSource%
77 echo 7zip=%zipPath%
78 echo Visual Studio=%vcvarsall%
79 echo InstallPath=%installpath%
80 echo BinPath=%binpath%
81 echo SourcePath=%sourcepath%
82
83 echo -----------------------------------
84 echo ------Downloading Sources----------
85 echo -----------------------------------
86
87 cd %sourcepath%\
88
89 %wgetPath% "http://releases.qt-project.org/qt4/source/%QTFNAME%"
90 %wgetPath% "http://sourceforge.net/projects/wxwindows/files/%WXVERSION%/%WXFNAME%/download"
91 %wgetPath% "http://sourceforge.net/projects/boost/files/boost/1.49.0/%BOOSTFNAME%/download"
92 %wgetPath% "http://mirror.ibcp.fr/pub/apache//xerces/c/3/sources/%XERCESFNAME%"
93 %wgetPath% "http://sourceforge.net/projects/itk/files/itk/3.20/%ITKFNAME%/download"
94 %wgetPath% "http://www.vtk.org/files/release/5.10/%VTKFNAME%"
95 %wgetPath% "%urlCreatisSource%/%GDCMFNAME%.gz"
96 %wgetPath% "http://hutchinson.belmont.ma.us/tth/tth-noncom/%TTHFNAME%"
97 %wgetPath% "ftp://ftp.qt.nokia.com/jom/%JOMFNAME%"
98
99 echo -----------------------------------
100 echo --------------Qt-------------------
101 echo -----------------------------------
102 call %vcvarsall%
103
104 cd %sourcepath%
105 %zipPath% x %sourcepath%\%QTFNAME%
106 del %sourcepath%\%QTFNAME%
107
108 echo -----------------------------------
109 echo --------------JOM------------------
110 echo -----------------------------------
111
112 cd %sourcepath%
113 %zipPath% x %sourcepath%\%JOMFNAME% -o*
114 del %sourcepath%\%JOMFNAME%
115
116 echo -----------------------------------
117 echo -----------wxWidgets---------------
118 echo -----------------------------------
119 echo ----------Extracting---------------
120
121 cd %sourcepath%
122 %zipPath% x %sourcepath%\%WXFNAME%
123   del %sourcepath%\%WXFNAME%
124
125 echo -----------------------------------
126 echo ------------Boost------------------
127 echo -----------------------------------
128
129 cd %sourcepath%
130 %zipPath% x %sourcepath%\%BOOSTFNAME%
131 del %sourcepath%\%BOOSTFNAME%
132
133 echo -----------------------------------
134 echo -------------VTK-------------------
135 echo -----------------------------------
136
137 cd %sourcepath%
138 %zipPath% x %sourcepath%\%VTKFNAME%
139 del %sourcepath%\%VTKFNAME%
140
141 echo -----------------------------------
142 echo ------------GDCM ------------------
143 echo -----------------------------------
144
145 cd %sourcepath%
146 %zipPath% x %GDCMFNAME%.gz
147 %zipPath% x %GDCMFNAME%
148 del %GDCMFNAME%.gz
149 del %GDCMFNAME%
150
151 echo -----------------------------------
152 echo -------------ITK-------------------
153 echo -----------------------------------
154
155 cd %sourcepath%
156 %zipPath% x %ITKFNAME%
157 del %ITKFNAME%
158
159 echo -----------------------------------
160 echo -------------XERCES----------------
161 echo -----------------------------------
162
163 cd %sourcepath%
164 %zipPath% x %XERCESFNAME%
165 del %XERCESFNAME%
166
167 echo -----------------------------------
168 echo --------------TTH------------------
169 echo -----------------------------------
170
171 cd %sourcepath%
172 %zipPath% x %TTHFNAME%
173 del %TTHFNAME%
174
175 echo ------End TTH Installation---------
176
177 echo -----------------------------------
178
179 echo -----------------------------------
180 echo --------Renaming Folders-----------
181 echo -----------------------------------
182 cd %sourcepath%
183 rename qt-everywhere-opensource-src-4.8.2 qt
184 rename wxWidgets-%WXVERSION% wxWidgets
185 rename boost_1_49_0 boost
186 rename InsightToolkit-3.20.1 itk
187 rename VTK vtk
188 rename gdcm gdcm13
189 rename tth_exe tth
190 rename xerces-c-3.1.1 xerces
191
192 echo -----End of Download Libraries-----
193 echo -----------------------------------
194 echo -----------------------------------
195
196 exit /B