]> Creatis software - creaToolsTools.git/blob - Install_ThirdParty/scripts/download_ThirdPartySW.bat
2017 SQLite Debug in version CreaTools win64 RELEASE
[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   pause
34   exit
35 )
36 if not exist %vcvarsall% set vcvarsall="%ProgramFilesPath_x64%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
37 if not exist %vcvarsall% (
38   echo ERROR!!! Visual Studio has not been found in the system
39   pause
40   exit
41 )
42
43 if not exist %wgetPath% (
44   echo ERROR!!! wget has not been found in the system
45   pause
46   exit
47 )
48
49 set installpath=%thirdpartyGeneration%\thirdparty_install\%buildType%
50 set binpath=%thirdpartyGeneration%\thirdparty_bin\%buildType%
51 set sourcepath=%thirdpartyGeneration%\thirdparty_source\%buildType%
52 set LogFolder=%thirdpartyGeneration%\installLog
53
54 set QTFNAME=qt-everywhere-opensource-src-4.8.2.zip
55
56 if %wxStable%==ON (
57         set WXFNAME=wxWidgets-2.8.12.zip
58         set WXVERSION=2.8.12
59 ) else (
60         set WXFNAME=wxWidgets-2.9.4.zip
61         set WXVERSION=2.9.4
62 )
63 else
64 REM set BOOSTFNAME=boost_1_49_0.7z
65 set BOOSTFNAME=boost_1_52_0.7z
66 set XERCESFNAME=xerces-c-3.1.1.zip
67 set ITKFNAME=InsightToolkit-3.20.1.zip
68 set VTKFNAME=vtk-5.10.0.zip
69 set GDCMFNAME=gdcm_11_Oct_2011.tar
70 ::set GDCMFNAME=gdcm_05_Mai_2011.tar
71 set TTHFNAME=tth_exe.zip
72 set JOMFNAME=jom.zip
73 set SQLITEFNAME=sqlite_v3.6.23.1.zip
74
75 echo -----------------------------------
76 echo Environment variables Configuration
77 echo -----------------------------------
78 echo ThirdpartyGeneration=%thirdpartyGeneration%
79 echo BuildType=%buildType%
80 echo wget=%wgetPath%
81 echo urlCreatis=%urlCreatisSource%
82 echo 7zip=%zipPath%
83 echo Visual Studio=%vcvarsall%
84 echo InstallPath=%installpath%
85 echo BinPath=%binpath%
86 echo SourcePath=%sourcepath%
87
88 echo -----------------------------------
89 echo ------Downloading Sources----------
90 echo -----------------------------------
91
92 cd %sourcepath%\
93
94 REM%wgetPath% "http://sourceforge.net/projects/itk/files/itk/3.20/%ITKFNAME%/download"
95 REM%wgetPath% "http://sourceforge.net/projects/wxwindows/files/%WXVERSION%/%WXFNAME%/download"
96 REM%wgetPath% "http://sourceforge.net/projects/boost/files/boost/1.49.0/%BOOSTFNAME%/download"
97
98 if %EEDdownloadQT%==FALSE GOTO SKIPDOWNLOADQT
99   %wgetPath% "http://releases.qt-project.org/qt4/source/%QTFNAME%"
100   %wgetPath% "http://releases.qt-project.org/jom/%JOMFNAME%"
101   echo -----------------------------------
102   echo --------------Qt-------------------
103   echo -----------------------------------
104   call %vcvarsall%
105   cd %sourcepath%
106   %zipPath% x %sourcepath%\%QTFNAME%
107   del %sourcepath%\%QTFNAME%
108   echo -----------------------------------
109   echo --------------JOM------------------
110   echo -----------------------------------
111   cd %sourcepath%
112   %zipPath% x %sourcepath%\%JOMFNAME% -o*
113   del %sourcepath%\%JOMFNAME%
114 :SKIPDOWNLOADQT
115   
116 if %EEDdownloadITK%==FALSE GOTO SKIPDOWNLOADITK
117   %wgetPath% "http://downloads.sourceforge.net/project/itk/itk/3.20/%ITKFNAME%?r=http%3A%2F%2Fwww.itk.org%2FITK%2Fresources%2Fsoftware.html&ts=1357254419&use_mirror=ufpr"
118   echo -----------------------------------
119   echo -------------ITK-------------------
120   echo -----------------------------------
121   cd %sourcepath%
122   %zipPath% x %ITKFNAME%
123   del %ITKFNAME%
124 :SKIPDOWNLOADITK
125   
126 if %EEDdownloadWXWINDOWS%==FALSE GOTO SKIPDOWNLOADWXWINDOWS
127   %wgetPath% "http://downloads.sourceforge.net/project/wxwindows/%WXVERSION%/%WXFNAME%?r=http%3A%2F%2Fwww.wxwidgets.org%2Fdownloads%2F%23latest_dev&ts=1357255370&use_mirror=ufpr"
128   echo -----------------------------------
129   echo -----------wxWidgets---------------
130   echo -----------------------------------
131   echo ----------Extracting---------------
132   cd %sourcepath%
133   %zipPath% x %sourcepath%\%WXFNAME%
134   del %sourcepath%\%WXFNAME%
135 :SKIPDOWNLOADWXWINDOWS
136
137 if %EEDdownloadBOOST%==FALSE GOTO SKIPDOWNLOADBOOST
138   REM %wgetPath% "http://downloads.sourceforge.net/project/boost/boost/1.49.0/%BOOSTFNAME%?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fboost%2F1.49.0%2F&ts=1357255694&use_mirror=hivelocity"
139   %wgetPath% "http://downloads.sourceforge.net/project/boost/boost/1.52.0/boost_1_52_0.7z?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fboost%2F1.52.0%2Fboost_1_52_0.7z%2Fdownload&ts=1360058777&use_mirror=ignum"
140   echo -----------------------------------
141   echo ------------Boost------------------
142   echo -----------------------------------
143   cd %sourcepath%
144   %zipPath% x %sourcepath%\%BOOSTFNAME%
145   del %sourcepath%\%BOOSTFNAME%
146 :SKIPDOWNLOADBOOST
147
148 if %EEDdownloadXERCES%==FALSE GOTO SKIPDOWNLOADXERCES
149   %wgetPath% "http://mirror.ibcp.fr/pub/apache//xerces/c/3/sources/%XERCESFNAME%"
150   echo -----------------------------------
151   echo -------------XERCES----------------
152   echo -----------------------------------
153   cd %sourcepath%
154   %zipPath% x %XERCESFNAME%
155   del %XERCESFNAME%
156 :SKIPDOWNLOADXERCES
157
158 if %EEDdownloadVTK%==FALSE GOTO SKIPDOWNLOADVTK
159   %wgetPath% "http://www.vtk.org/files/release/5.10/%VTKFNAME%"
160   echo -----------------------------------
161   echo -------------VTK-------------------
162   echo -----------------------------------
163   cd %sourcepath%
164   %zipPath% x %sourcepath%\%VTKFNAME%
165   del %sourcepath%\%VTKFNAME%
166 :SKIPDOWNLOADVTK
167   
168 if %EEDdownloadGDCM%==FALSE GOTO SKIPDOWNLOADGDCM
169   %wgetPath% "%urlCreatisSource%/%GDCMFNAME%.gz"
170   echo -----------------------------------
171   echo ------------GDCM ------------------
172   echo -----------------------------------
173   cd %sourcepath%
174   %zipPath% x %GDCMFNAME%.gz
175   %zipPath% x %GDCMFNAME%
176   del %GDCMFNAME%.gz
177   del %GDCMFNAME%
178 :SKIPDOWNLOADGDCM
179   
180 if %EEDdownloadTTH%==FALSE GOTO SKIPDOWNLOADTTH
181   %wgetPath% "http://hutchinson.belmont.ma.us/tth/tth-noncom/%TTHFNAME%"
182   echo -----------------------------------
183   echo --------------TTH------------------
184   echo -----------------------------------
185   cd %sourcepath%
186   %zipPath% x %TTHFNAME%
187   del %TTHFNAME%
188 :SKIPDOWNLOADTTH
189
190 if %EEDdownloadSQLite%==FALSE GOTO SKIPDOWNLOADSQLITE
191   %wgetPath% "http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/%SQLITEFNAME%"
192   echo ------------------------------------------------
193   echo --------------SQLite (creatis)------------------
194   echo ------------------------------------------------
195   cd %sourcepath%
196   %zipPath% x %SQLITEFNAME%
197   del %SQLITEFNAME%
198 :SKIPDOWNLOADSQLITE
199
200
201 echo -----------------------------------
202 echo --------Renaming Folders-----------
203 echo -----------------------------------
204 cd %sourcepath%
205 rename qt-everywhere-opensource-src-4.8.2 qt
206 rename wxWidgets-%WXVERSION% wxWidgets
207 REM rename boost_1_49_0 boost
208 rename boost_1_52_0 boost
209 rename InsightToolkit-3.20.1 itk
210 rename VTK vtk
211 rename gdcm gdcm13
212 rename tth_exe tth
213 rename xerces-c-3.1.1 xerces
214 rename sqlite_v3.6.23.1 sqlite
215
216 echo -----End of Download Libraries-----
217 echo -----------------------------------
218 echo -----------------------------------
219
220 exit /B