2 echo -----------------------------------
3 echo ------Asking Architecture----------
4 echo -----------------------------------
5 if %PROCESSOR_ARCHITECTURE%==x86 (
6 set ProgramFilesPath_x86=%ProgramFiles%
7 echo "Architecture found = x86"
9 set "ProgramFilesPath_x64=%ProgramFiles%"
10 set "ProgramFilesPath_x86=%ProgramFiles(x86)%"
11 echo "Architecture found = x64"
14 echo ----End Asking Architecture--------
16 echo -----------------------------------
17 echo ---Setting Environment Variables----
18 echo -----------------------------------
20 set thirdpartyGeneration=%1
23 set urlCreatisSource=http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source
24 set urlCreatisSource=http://www.creatis.insa-lyon.fr/~caceres/software
26 set zipPath="%ProgramFilesPath_x86%\7-Zip\7z.exe"
27 set miktex="%ProgramFilesPath_x86%\MiKTeX 2.9\miktex\bin\texworks.exe"
28 set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
29 set wgetPath=%cd%\..\..\windows\creaTools_win_installers\CreaTools_v2_0_0_win32_installer\bin\wget.exe
31 if not exist %zipPath% set zipPath="%ProgramFilesPath_x64%\7-Zip\7z.exe"
32 if not exist %zipPath% (
33 echo ERROR!!! 7Zip has not been found in the system
36 if not exist %vcvarsall% set zipPath="%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
41 if not exist %miktex% set miktex="%ProgramFilesPath_x64%\MiKTeX 2.9\miktex\bin\texworks.exe"
42 if not exist %miktex% (
43 echo ERROR!!! MiKTex has not been found in the system
46 if not exist %wgetPath% (
47 echo ERROR!!! wget has not been found in the system
52 set installpath=%thirdpartyGeneration%\thirdparty_install
53 set binpath=%thirdpartyGeneration%\thirdparty_bin
54 set sourcepath=%thirdpartyGeneration%\thirdparty_source
57 set wxWidgets=wxWidgets-2.9.2
58 set boost=Boost-1.47.0
59 set xercesc=xerces-c-3.1.1
60 set itk=InsightToolkit-3.20.0
64 set QTDIR=%sourcepath%\%qt%
65 set WXDIR=%sourcepath%\%wxWidgets%
66 set BOOSTDIR=%sourcepath%\%boost%
67 set XERCESDIR=%sourcepath%\%xercesc%
68 set ITKSRCDIR=%sourcepath%\%itk%
69 set VTKSRCDIR=%sourcepath%\%VTK%
70 set GDCMSRCDIR=%sourcepath%\%gdcm%
72 echo -----------------------------------
73 echo Environment variables Configuration
74 echo -----------------------------------
75 echo ThirdpartyGeneration=%thirdpartyGeneration%
76 echo BuildType=%buildType%
79 echo urlCreatis=%urlCreatisSource%
81 echo Visual Studio=%vcvarsall%
82 echo InstallPath=%installpath%
83 echo BinPath=%binpath%
84 echo SourcePath%sourcepath%
88 echo Xercesc=%xercesc%
94 echo BOOSTDIR=%BOOSTDIR%
95 echo XERCESDIR=%XERCESDIR%
96 echo ITKSRCDIR=%ITKSRCDIR%
97 echo VTKSRCDIR=%VTKSRCDIR%
98 echo GDCMDIR=%GDCMSRCDIR%
100 echo ---End Setting Global Variables----
101 echo -----------------------------------
105 echo -----------------------------------
106 echo -------Creating Folders------------
107 echo -----------------------------------
109 rmdir %binpath% /s /q
111 rmdir %thirdpartyGeneration% /s /q
112 mkdir %thirdpartyGeneration%
113 cd %thirdpartyGeneration%
114 mkdir thirdparty_source
116 mkdir thirdparty_install
119 echo ------End Creating Folders---------
121 echo -----------------------------------
122 echo ------Downloading Sources----------
123 echo -----------------------------------
125 cd %thirdpartyGeneration%\thirdparty_source\
126 %wgetPath% %urlCreatisSource%/qt-4.7.3.zip
127 %wgetPath% %urlCreatisSource%/wxWidgets-2.9.2.7z
128 %wgetPath% %urlCreatisSource%/boost_1_47_0.7z
129 %wgetPath% %urlCreatisSource%/vtk-5.8.0.tar.gz
130 %wgetPath% %urlCreatisSource%/InsightToolkit-3.20.0.zip
131 %wgetPath% %urlCreatisSource%/gdcm_11_Oct_2011.tar.gz
132 %wgetPath% %urlCreatisSource%/xerces-c-3.1.1.zip
133 %wgetPath% %urlCreatisSource%/tth_exe.zip
134 echo ------End Downloading Sources------
136 echo -----------------------------------
137 echo --------Qt Installation------------
138 echo -----------------------------------
139 echo ----------Extracting---------------
142 %zipPath% x %sourcepath%\qt-4.7.3.zip
143 del %sourcepath%\qt-4.7.3.zip
145 echo --------Renaming Folder------------
147 rename qt-everywhere-opensource-src-4.7.3 %qt%
149 echo ----------Installing---------------
155 if %PROCESSOR_ARCHITECTURE%==x86 (
156 echo y | configure -%buildType% -opensource -shared -qt-sql-sqlite -phonon -phonon-backend -platform win32-msvc2010 -mp
158 echo y | configure -%buildType% -opensource -shared -qt-sql-sqlite -phonon -phonon-backend -platform win32-msvc2010 -mp
164 echo ------End QT Installation----------
166 echo -----------------------------------
167 echo -----wxWidgets Installation--------
168 echo -----------------------------------
169 echo ----------Extracting---------------
174 %zipPath% x %sourcepath%\wxWidgets-2.9.2.7z
175 del %sourcepath%\wxWidgets-2.9.2.7z
177 echo ----------Installing---------------
179 cd %sourcepath%\%wxWidgets%\build\msw
180 nmake -f makefile.vc BUILD=%buildType% UNICODE=1 SHARED=1
183 echo ----End wxWidgets Installation-----
185 echo -----------------------------------
186 echo ------Boost Installation-----------
187 echo -----------------------------------
188 echo ----------Extracting---------------
191 %zipPath% x %thirdpartyGeneration%\thirdparty_source\boost_1_47_0.7z
192 del %thirdpartyGeneration%\thirdparty_source\boost_1_47_0.7z
194 echo --------Renaming Folder------------
196 rename boost_1_47_0 %boost%
198 echo ----------Installing---------------
200 cd %sourcepath%\%boost%
203 if %PROCESSOR_ARCHITECTURE%==x86 (
205 b2.exe --toolset=msvc-10.0 --build-type=complete stage
210 b2.exe --toolset=msvc-10.0 --build-type=complete architecture=x86 address-model=64 stage
216 echo -----End Boost Installation--------
218 echo -----------------------------------
219 echo -------ITK Installation------------
220 echo -----------------------------------
221 echo ----------Extracting---------------
224 %zipPath% x InsightToolkit-3.20.0.zip
225 del InsightToolkit-3.20.0.zip
227 echo ----------Installing---------------
232 cmake -G"Visual Studio 10" -H%sourcepath%\%itk% -B%binpath%\%itk%Bin
233 cmake -D CMAKE_INSTALL_PREFIX:PATH=%installpath%\%itk%\ -D BUILD_EXAMPLES:BOOL=OFF -D BUILD_TESTING:BOOL=OFF -D BUILD_SHARED_LIBS:BOOL=ON -D ITK_USE_REVIEW:BOOL=ON CMakeCache.txt
234 cmake -D USE_DEBUG_LIB:BOOL=%buildType% CMakeCache.txt
236 FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%buildType%
237 msbuild /p:Configuration=%buildType% INSTALL.vcxproj
240 echo ------End ITK Installation---------
242 echo -----------------------------------
243 echo ------XERCES Installation----------
244 echo -----------------------------------
245 echo ----------Extracting---------------
248 %zipPath% x xerces-c-3.1.1.zip
249 del xerces-c-3.1.1.zip
251 echo ----------Installing---------------
253 cd %sourcepath%\%xercesc%\projects\Win32\VC10\xerces-all
254 FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=build
255 FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%buildType%
256 msbuild /p:Configuration=%buildType% INSTALL.vcxproj
258 echo -----End XERCES Installation-------
260 echo -----------------------------------
261 echo -------VTK Installation------------
262 echo -----------------------------------
263 echo ----------Extracting---------------
266 %zipPath% x %thirdpartyGeneration%\thirdparty_source\VTK-5.8.0.tar.gz
267 %zipPath% x %thirdpartyGeneration%\thirdparty_source\VTK-5.8.0.tar
268 cd %thirdpartyGeneration%\thirdparty_source\VTK
269 del %thirdpartyGeneration%\thirdparty_source\VTK-5.8.0.tar.gz
270 del %thirdpartyGeneration%\thirdparty_source\VTK-5.8.0.tar
272 echo ----------Installing---------------
278 cmake -G"Visual Studio 10" -H%sourcepath%\%vtk% -B%binpath%\%vtk%Bin
279 cmake -D USE_DEBUG_LIB:BOOL=%buildType% -D CMAKE_INSTALL_PREFIX:PATH=%installpath%\%vtk%\ CMakeCache.txt
280 cmake -D BUILD_EXAMPLES:BOOL=OFF -D BUILD_TESTING:BOOL=OFF -D BUILD_SHARED_LIBS:BOOL=ON -D VTK_USE_QT:BOOL=ON CMakeCache.txt
282 FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%buildType%
283 msbuild /p:Configuration=%buildType% INSTALL.vcxproj
285 echo ------End VTK Installation---------
287 echo -----------------------------------
288 echo -------GDCM Installation-----------
289 echo -----------------------------------
290 echo ----------Extracting---------------
293 %zipPath% x gdcm_11_Oct_2011.tar.gz
294 %zipPath% x gdcm_11_Oct_2011.tar
295 del gdcm_11_Oct_2011.tar.gz
296 del gdcm_11_Oct_2011.tar
298 echo ----------Installing---------------
305 cmake -G"Visual Studio 10" -H%sourcepath%\%gdcm% -B%binpath%\%gdcm%Bin
306 cmake -D USE_DEBUG_LIB:BOOL=%buildType% -D CMAKE_INSTALL_PREFIX:PATH=%installpath%\%gdcm%\ CMakeCache.txt
307 cmake -D VTK_DIR:PATH=%binpath%\%vtk%Bin -D GDCM_VTK:BOOL=ON -D BUILD_TESTING:BOOL=OFF -D GDCM_NAME_SPACE:STRING=gdcm13 CMakeCache.txt
309 FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%buildType%
310 msbuild /p:Configuration=%buildType% INSTALL.vcxproj
313 echo -----End GDCM Installation---------
315 echo -----------------------------------
316 echo -------TTH Installation------------
317 echo -----------------------------------
318 echo ----------Extracting---------------
320 %zipPath% x tth_exe.zip
323 echo ------End TTH Installation---------