@echo off echo ----------------------------------- echo --------Download Libraries--------- echo ----------------------------------- echo ----------------------------------- echo ---Setting Environment Variables--- echo ----------------------------------- set thirdpartyGeneration=%1 set buildType=%2 set wxStable=%3 :: set urlCreatisSource=http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source set urlCreatisSource=http://www.creatis.insa-lyon.fr/~caceres/software if %PROCESSOR_ARCHITECTURE%==x86 ( set ProgramFilesPath_x86=%ProgramFiles% echo "Architecture found = x86" ) else ( set "ProgramFilesPath_x64=%ProgramFiles%" set "ProgramFilesPath_x86=%ProgramFiles(x86)%" echo "Architecture found = x64" ) set zipPath="%ProgramFilesPath_x86%\7-Zip\7z.exe" set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" set wgetPath="%ProgramFilesPath_x86%\GnuWin32\bin\wget.exe" if not exist %zipPath% set zipPath="%ProgramFilesPath_x64%\7-Zip\7z.exe" if not exist %zipPath% ( echo ERROR!!! 7Zip has not been found in the system pause exit ) if not exist %vcvarsall% set vcvarsall="%ProgramFilesPath_x64%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" if not exist %vcvarsall% ( echo ERROR!!! Visual Studio has not been found in the system pause exit ) if not exist %wgetPath% ( echo ERROR!!! wget has not been found in the system pause exit ) set installpath=%thirdpartyGeneration%\thirdparty_install\%buildType% set binpath=%thirdpartyGeneration%\thirdparty_bin\%buildType% set sourcepath=%thirdpartyGeneration%\thirdparty_source\%buildType% set LogFolder=%thirdpartyGeneration%\installLog set QTFNAME=qt-everywhere-opensource-src-4.8.2.zip if %wxStable%==ON ( set WXFNAME=wxWidgets-2.8.12.zip set WXVERSION=2.8.12 ) else ( set WXFNAME=wxWidgets-2.9.4.zip set WXVERSION=2.9.4 ) else REM set BOOSTFNAME=boost_1_49_0.7z set BOOSTFNAME=boost_1_52_0.7z set XERCESFNAME=xerces-c-3.1.1.zip set ITKFNAME=InsightToolkit-3.20.1.zip set VTKFNAME=vtk-5.10.0.zip set GDCMFNAME=gdcm_11_Oct_2011.tar ::set GDCMFNAME=gdcm_05_Mai_2011.tar set TTHFNAME=tth_exe.zip set JOMFNAME=jom.zip echo ----------------------------------- echo Environment variables Configuration echo ----------------------------------- echo ThirdpartyGeneration=%thirdpartyGeneration% echo BuildType=%buildType% echo wget=%wgetPath% echo urlCreatis=%urlCreatisSource% echo 7zip=%zipPath% echo Visual Studio=%vcvarsall% echo InstallPath=%installpath% echo BinPath=%binpath% echo SourcePath=%sourcepath% echo ----------------------------------- echo ------Downloading Sources---------- echo ----------------------------------- cd %sourcepath%\ REM%wgetPath% "http://sourceforge.net/projects/itk/files/itk/3.20/%ITKFNAME%/download" REM%wgetPath% "http://sourceforge.net/projects/wxwindows/files/%WXVERSION%/%WXFNAME%/download" REM%wgetPath% "http://sourceforge.net/projects/boost/files/boost/1.49.0/%BOOSTFNAME%/download" if %EEDdownloadQT%==FALSE GOTO SKIPDOWNLOADQT %wgetPath% "http://releases.qt-project.org/qt4/source/%QTFNAME%" %wgetPath% "http://releases.qt-project.org/jom/%JOMFNAME%" echo ----------------------------------- echo --------------Qt------------------- echo ----------------------------------- call %vcvarsall% cd %sourcepath% %zipPath% x %sourcepath%\%QTFNAME% del %sourcepath%\%QTFNAME% echo ----------------------------------- echo --------------JOM------------------ echo ----------------------------------- cd %sourcepath% %zipPath% x %sourcepath%\%JOMFNAME% -o* del %sourcepath%\%JOMFNAME% :SKIPDOWNLOADQT if %EEDdownloadITK%==FALSE GOTO SKIPDOWNLOADITK %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" echo ----------------------------------- echo -------------ITK------------------- echo ----------------------------------- cd %sourcepath% %zipPath% x %ITKFNAME% del %ITKFNAME% :SKIPDOWNLOADITK if %EEDdownloadWXWINDOWS%==FALSE GOTO SKIPDOWNLOADWXWINDOWS %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" echo ----------------------------------- echo -----------wxWidgets--------------- echo ----------------------------------- echo ----------Extracting--------------- cd %sourcepath% %zipPath% x %sourcepath%\%WXFNAME% del %sourcepath%\%WXFNAME% :SKIPDOWNLOADWXWINDOWS if %EEDdownloadBOOST%==FALSE GOTO SKIPDOWNLOADBOOST 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" %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" echo ----------------------------------- echo ------------Boost------------------ echo ----------------------------------- cd %sourcepath% %zipPath% x %sourcepath%\%BOOSTFNAME% del %sourcepath%\%BOOSTFNAME% :SKIPDOWNLOADBOOST if %EEDdownloadXERCES%==FALSE GOTO SKIPDOWNLOADXERCES %wgetPath% "http://mirror.ibcp.fr/pub/apache//xerces/c/3/sources/%XERCESFNAME%" echo ----------------------------------- echo -------------XERCES---------------- echo ----------------------------------- cd %sourcepath% %zipPath% x %XERCESFNAME% del %XERCESFNAME% :SKIPDOWNLOADXERCES if %EEDdownloadVTK%==FALSE GOTO SKIPDOWNLOADVTK %wgetPath% "http://www.vtk.org/files/release/5.10/%VTKFNAME%" echo ----------------------------------- echo -------------VTK------------------- echo ----------------------------------- cd %sourcepath% %zipPath% x %sourcepath%\%VTKFNAME% del %sourcepath%\%VTKFNAME% :SKIPDOWNLOADVTK if %EEDdownloadGDCM%==FALSE GOTO SKIPDOWNLOADGDCM %wgetPath% "%urlCreatisSource%/%GDCMFNAME%.gz" echo ----------------------------------- echo ------------GDCM ------------------ echo ----------------------------------- cd %sourcepath% %zipPath% x %GDCMFNAME%.gz %zipPath% x %GDCMFNAME% del %GDCMFNAME%.gz del %GDCMFNAME% :SKIPDOWNLOADGDCM if %EEDdownloadTTH%==FALSE GOTO SKIPDOWNLOADTTH %wgetPath% "http://hutchinson.belmont.ma.us/tth/tth-noncom/%TTHFNAME%" echo ----------------------------------- echo --------------TTH------------------ echo ----------------------------------- cd %sourcepath% %zipPath% x %TTHFNAME% del %TTHFNAME% :SKIPDOWNLOADTTH echo ----------------------------------- echo --------Renaming Folders----------- echo ----------------------------------- cd %sourcepath% rename qt-everywhere-opensource-src-4.8.2 qt rename wxWidgets-%WXVERSION% wxWidgets REM rename boost_1_49_0 boost rename boost_1_52_0 boost rename InsightToolkit-3.20.1 itk rename VTK vtk rename gdcm gdcm13 rename tth_exe tth rename xerces-c-3.1.1 xerces echo -----End of Download Libraries----- echo ----------------------------------- echo ----------------------------------- exit /B