]> Creatis software - creaToolsTools.git/blob - Install_ThirdParty/scripts/download_ThirdPartySW.bat
Feature #1773 Add licence terms for all files.
[creaToolsTools.git] / Install_ThirdParty / scripts / download_ThirdPartySW.bat
1 REM ---------------------------------------------------------------------
2 REM
3 REM Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
4 REM                        pour la Santé)
5 REM Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 REM
7 REM  This software is governed by the CeCILL-B license under French law and 
8 REM  abiding by the rules of distribution of free software. You can  use, 
9 REM  modify and/ or redistribute the software under the terms of the CeCILL-B 
10 REM  license as circulated by CEA, CNRS and INRIA at the following URL 
11 REM  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
12 REM  or in the file LICENSE.txt.
13 REM
14 REM  As a counterpart to the access to the source code and  rights to copy,
15 REM  modify and redistribute granted by the license, users are provided only
16 REM  with a limited warranty  and the software's author,  the holder of the
17 REM  economic rights,  and the successive licensors  have only  limited
18 REM  liability. 
19 REM
20 REM  The fact that you are presently reading this means that you have had
21 REM  knowledge of the CeCILL-B license and that you accept its terms.
22 REM ------------------------------------------------------------------------  
23
24 @echo off
25 echo -----------------------------------
26 echo --------Download Libraries---------
27 echo -----------------------------------
28
29 echo -----------------------------------
30 echo ---Setting Environment Variables---
31 echo -----------------------------------
32
33 set thirdpartyGeneration=%1
34 set buildType=%2
35 set wxStable=%3
36
37 :: set urlCreatisSource=http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source
38 set urlCreatisSource=http://www.creatis.insa-lyon.fr/~caceres/software
39
40 if %PROCESSOR_ARCHITECTURE%==x86 (
41   set ProgramFilesPath_x86=%ProgramFiles%
42   echo "Architecture found = x86"
43 ) else (
44   set "ProgramFilesPath_x64=%ProgramFiles%"
45   set "ProgramFilesPath_x86=%ProgramFiles(x86)%"
46   echo "Architecture found = x64"
47 )
48
49 set zipPath="%ProgramFilesPath_x86%\7-Zip\7z.exe"
50 set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
51 set wgetPath="%ProgramFilesPath_x86%\GnuWin32\bin\wget.exe"
52
53 if not exist %zipPath% set zipPath="%ProgramFilesPath_x64%\7-Zip\7z.exe"
54 if not exist %zipPath% (
55   echo ERROR!!! 7Zip has not been found in the system
56   exit
57 )
58 if not exist %vcvarsall% set vcvarsall="%ProgramFilesPath_x64%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
59 if not exist %vcvarsall% (
60   echo ERROR!!! Visual Studio has not been found in the system
61   exit
62 )
63
64 if not exist %wgetPath% (
65   echo ERROR!!! wget has not been found in the system
66   exit
67 )
68
69 set installpath=%thirdpartyGeneration%\thirdparty_install\%buildType%
70 set binpath=%thirdpartyGeneration%\thirdparty_bin\%buildType%
71 set sourcepath=%thirdpartyGeneration%\thirdparty_source\%buildType%
72 set LogFolder=%thirdpartyGeneration%\installLog
73
74 set QTFNAME=qt-everywhere-opensource-src-4.8.2.zip
75
76 if %wxStable%==ON (
77         set WXFNAME=wxWidgets-2.8.12.zip
78         set WXVERSION=2.8.12
79 ) else (
80         set WXFNAME=wxWidgets-2.9.3.zip
81         set WXVERSION=2.9.2
82 )
83 else
84 set BOOSTFNAME=boost_1_49_0.7z
85 set XERCESFNAME=xerces-c-3.1.1.zip
86 set ITKFNAME=InsightToolkit-3.20.1.zip
87 set VTKFNAME=vtk-5.10.0.zip
88 set GDCMFNAME=gdcm_11_Oct_2011.tar
89 ::set GDCMFNAME=gdcm_05_Mai_2011.tar
90 set TTHFNAME=tth_exe.zip
91 set JOMFNAME=jom.zip
92
93 echo -----------------------------------
94 echo Environment variables Configuration
95 echo -----------------------------------
96 echo ThirdpartyGeneration=%thirdpartyGeneration%
97 echo BuildType=%buildType%
98 echo wget=%wgetPath%
99 echo urlCreatis=%urlCreatisSource%
100 echo 7zip=%zipPath%
101 echo Visual Studio=%vcvarsall%
102 echo InstallPath=%installpath%
103 echo BinPath=%binpath%
104 echo SourcePath=%sourcepath%
105
106 echo -----------------------------------
107 echo ------Downloading Sources----------
108 echo -----------------------------------
109
110 cd %sourcepath%\
111
112 %wgetPath% "http://releases.qt-project.org/qt4/source/%QTFNAME%"
113 %wgetPath% "http://sourceforge.net/projects/wxwindows/files/%WXVERSION%/%WXFNAME%/download"
114 %wgetPath% "http://sourceforge.net/projects/boost/files/boost/1.49.0/%BOOSTFNAME%/download"
115 %wgetPath% "http://mirror.ibcp.fr/pub/apache//xerces/c/3/sources/%XERCESFNAME%"
116 %wgetPath% "http://sourceforge.net/projects/itk/files/itk/3.20/%ITKFNAME%/download"
117 %wgetPath% "http://www.vtk.org/files/release/5.10/%VTKFNAME%"
118 %wgetPath% "%urlCreatisSource%/%GDCMFNAME%.gz"
119 %wgetPath% "http://hutchinson.belmont.ma.us/tth/tth-noncom/%TTHFNAME%"
120 %wgetPath% "ftp://ftp.qt.nokia.com/jom/%JOMFNAME%"
121
122 echo -----------------------------------
123 echo --------------Qt-------------------
124 echo -----------------------------------
125 call %vcvarsall%
126
127 cd %sourcepath%
128 %zipPath% x %sourcepath%\%QTFNAME%
129 del %sourcepath%\%QTFNAME%
130
131 echo -----------------------------------
132 echo --------------JOM------------------
133 echo -----------------------------------
134
135 cd %sourcepath%
136 %zipPath% x %sourcepath%\%JOMFNAME% -o*
137 del %sourcepath%\%JOMFNAME%
138
139 echo -----------------------------------
140 echo -----------wxWidgets---------------
141 echo -----------------------------------
142 echo ----------Extracting---------------
143
144 cd %sourcepath%
145 %zipPath% x %sourcepath%\%WXFNAME%
146   del %sourcepath%\%WXFNAME%
147
148 echo -----------------------------------
149 echo ------------Boost------------------
150 echo -----------------------------------
151
152 cd %sourcepath%
153 %zipPath% x %sourcepath%\%BOOSTFNAME%
154 del %sourcepath%\%BOOSTFNAME%
155
156 echo -----------------------------------
157 echo -------------VTK-------------------
158 echo -----------------------------------
159
160 cd %sourcepath%
161 %zipPath% x %sourcepath%\%VTKFNAME%
162 del %sourcepath%\%VTKFNAME%
163
164 echo -----------------------------------
165 echo ------------GDCM ------------------
166 echo -----------------------------------
167
168 cd %sourcepath%
169 %zipPath% x %GDCMFNAME%.gz
170 %zipPath% x %GDCMFNAME%
171 del %GDCMFNAME%.gz
172 del %GDCMFNAME%
173
174 echo -----------------------------------
175 echo -------------ITK-------------------
176 echo -----------------------------------
177
178 cd %sourcepath%
179 %zipPath% x %ITKFNAME%
180 del %ITKFNAME%
181
182 echo -----------------------------------
183 echo -------------XERCES----------------
184 echo -----------------------------------
185
186 cd %sourcepath%
187 %zipPath% x %XERCESFNAME%
188 del %XERCESFNAME%
189
190 echo -----------------------------------
191 echo --------------TTH------------------
192 echo -----------------------------------
193
194 cd %sourcepath%
195 %zipPath% x %TTHFNAME%
196 del %TTHFNAME%
197
198 echo ------End TTH Installation---------
199
200 echo -----------------------------------
201
202 echo -----------------------------------
203 echo --------Renaming Folders-----------
204 echo -----------------------------------
205 cd %sourcepath%
206 rename qt-everywhere-opensource-src-4.8.2 qt
207 rename wxWidgets-%WXVERSION% wxWidgets
208 rename boost_1_49_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
215 echo -----End of Download Libraries-----
216 echo -----------------------------------
217 echo -----------------------------------
218
219 exit /B