]> Creatis software - creaToolsTools.git/blob - Install_ThirdParty/scripts/download_ThirdPartySW.bat
9604c29da67f1d6fbc153ef6d873c66dda02adf1
[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
74 echo -----------------------------------
75 echo Environment variables Configuration
76 echo -----------------------------------
77 echo ThirdpartyGeneration=%thirdpartyGeneration%
78 echo BuildType=%buildType%
79 echo wget=%wgetPath%
80 echo urlCreatis=%urlCreatisSource%
81 echo 7zip=%zipPath%
82 echo Visual Studio=%vcvarsall%
83 echo InstallPath=%installpath%
84 echo BinPath=%binpath%
85 echo SourcePath=%sourcepath%
86
87 echo -----------------------------------
88 echo ------Downloading Sources----------
89 echo -----------------------------------
90
91 cd %sourcepath%\
92
93 REM%wgetPath% "http://sourceforge.net/projects/itk/files/itk/3.20/%ITKFNAME%/download"
94 REM%wgetPath% "http://sourceforge.net/projects/wxwindows/files/%WXVERSION%/%WXFNAME%/download"
95 REM%wgetPath% "http://sourceforge.net/projects/boost/files/boost/1.49.0/%BOOSTFNAME%/download"
96
97 if %EEDdownloadQT%==FALSE GOTO SKIPDOWNLOADQT
98   %wgetPath% "http://releases.qt-project.org/qt4/source/%QTFNAME%"
99   %wgetPath% "http://releases.qt-project.org/jom/%JOMFNAME%"
100   echo -----------------------------------
101   echo --------------Qt-------------------
102   echo -----------------------------------
103   call %vcvarsall%
104   cd %sourcepath%
105   %zipPath% x %sourcepath%\%QTFNAME%
106   del %sourcepath%\%QTFNAME%
107   echo -----------------------------------
108   echo --------------JOM------------------
109   echo -----------------------------------
110   cd %sourcepath%
111   %zipPath% x %sourcepath%\%JOMFNAME% -o*
112   del %sourcepath%\%JOMFNAME%
113 :SKIPDOWNLOADQT
114   
115 if %EEDdownloadITK%==FALSE GOTO SKIPDOWNLOADITK
116   %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"
117   echo -----------------------------------
118   echo -------------ITK-------------------
119   echo -----------------------------------
120   cd %sourcepath%
121   %zipPath% x %ITKFNAME%
122   del %ITKFNAME%
123 :SKIPDOWNLOADITK
124   
125 if %EEDdownloadWXWINDOWS%==FALSE GOTO SKIPDOWNLOADWXWINDOWS
126   %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"
127   echo -----------------------------------
128   echo -----------wxWidgets---------------
129   echo -----------------------------------
130   echo ----------Extracting---------------
131   cd %sourcepath%
132   %zipPath% x %sourcepath%\%WXFNAME%
133   del %sourcepath%\%WXFNAME%
134 :SKIPDOWNLOADWXWINDOWS
135
136 if %EEDdownloadBOOST%==FALSE GOTO SKIPDOWNLOADBOOST
137   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"
138   %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"
139   echo -----------------------------------
140   echo ------------Boost------------------
141   echo -----------------------------------
142   cd %sourcepath%
143   %zipPath% x %sourcepath%\%BOOSTFNAME%
144   del %sourcepath%\%BOOSTFNAME%
145 :SKIPDOWNLOADBOOST
146
147 if %EEDdownloadXERCES%==FALSE GOTO SKIPDOWNLOADXERCES
148   %wgetPath% "http://mirror.ibcp.fr/pub/apache//xerces/c/3/sources/%XERCESFNAME%"
149   echo -----------------------------------
150   echo -------------XERCES----------------
151   echo -----------------------------------
152   cd %sourcepath%
153   %zipPath% x %XERCESFNAME%
154   del %XERCESFNAME%
155 :SKIPDOWNLOADXERCES
156
157 if %EEDdownloadVTK%==FALSE GOTO SKIPDOWNLOADVTK
158   %wgetPath% "http://www.vtk.org/files/release/5.10/%VTKFNAME%"
159   echo -----------------------------------
160   echo -------------VTK-------------------
161   echo -----------------------------------
162   cd %sourcepath%
163   %zipPath% x %sourcepath%\%VTKFNAME%
164   del %sourcepath%\%VTKFNAME%
165 :SKIPDOWNLOADVTK
166   
167 if %EEDdownloadGDCM%==FALSE GOTO SKIPDOWNLOADGDCM
168   %wgetPath% "%urlCreatisSource%/%GDCMFNAME%.gz"
169   echo -----------------------------------
170   echo ------------GDCM ------------------
171   echo -----------------------------------
172   cd %sourcepath%
173   %zipPath% x %GDCMFNAME%.gz
174   %zipPath% x %GDCMFNAME%
175   del %GDCMFNAME%.gz
176   del %GDCMFNAME%
177 :SKIPDOWNLOADGDCM
178   
179 if %EEDdownloadTTH%==FALSE GOTO SKIPDOWNLOADTTH
180   %wgetPath% "http://hutchinson.belmont.ma.us/tth/tth-noncom/%TTHFNAME%"
181   echo -----------------------------------
182   echo --------------TTH------------------
183   echo -----------------------------------
184   cd %sourcepath%
185   %zipPath% x %TTHFNAME%
186   del %TTHFNAME%
187 :SKIPDOWNLOADTTH
188
189
190
191 echo -----------------------------------
192 echo --------Renaming Folders-----------
193 echo -----------------------------------
194 cd %sourcepath%
195 rename qt-everywhere-opensource-src-4.8.2 qt
196 rename wxWidgets-%WXVERSION% wxWidgets
197 REM rename boost_1_49_0 boost
198 rename boost_1_52_0 boost
199 rename InsightToolkit-3.20.1 itk
200 rename VTK vtk
201 rename gdcm gdcm13
202 rename tth_exe tth
203 rename xerces-c-3.1.1 xerces
204
205 echo -----End of Download Libraries-----
206 echo -----------------------------------
207 echo -----------------------------------
208
209 exit /B