]> Creatis software - creaToolsTools.git/blobdiff - Install_ThirdParty/scripts/install_thirdparty_all.bat
Change in script
[creaToolsTools.git] / Install_ThirdParty / scripts / install_thirdparty_all.bat
index fa613b2e001384e685069035f7fcb3c182f58dc5..5a6a2bb6a22080d5a4b747b364965a62cc4b7212 100644 (file)
-rem ---Asking Architecture-------------
 @echo off
+echo -----------------------------------
+echo ------Installing Libraries---------
+echo -----------------------------------
+echo -----------------------------------
+echo ------Asking Architecture----------
+echo -----------------------------------
 if %PROCESSOR_ARCHITECTURE%==x86 (
-@echo on
-  set ProgramFilesPath=%ProgramFiles%
-@echo off
+  set ProgramFilesPath_x86=%ProgramFiles%
+  echo "Architecture found = x86"
 ) else (
-@echo on
-  set ProgramFilesPath=%ProgramFiles(x86)%
-@echo off
+  set "ProgramFilesPath_x64=%ProgramFiles%"
+  set "ProgramFilesPath_x86=%ProgramFiles(x86)%"
+  echo "Architecture found = x64"
 )
-@echo on
 
-rem ----Setting Global Variables-------
+echo ----End Asking Architecture--------
+
+echo -----------------------------------
+echo ---Setting Environment Variables---
+echo -----------------------------------
+
 set thirdpartyGeneration=%1
 set buildType=%2
 
-set wgetPath=%~p0
-set wgetPath=%wgetPath%\..\..\windows\creaTools_win_installers\CreaTools_v2_0_0_win32_installer\bin
-set zipPath="%ProgramFilesPath%\7-Zip\7z.exe"
 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
-set vcvarsall="%ProgramFilesPath%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
 
-set installpath=%thirdpartyGeneration%\thirdparty_install
-set binpath=%thirdpartyGeneration%\thirdparty_bin
-set sourcepath=%thirdpartyGeneration%\thirdparty_source
+set zipPath="%ProgramFilesPath_x86%\7-Zip\7z.exe"
+set miktex="%ProgramFilesPath_x86%\MiKTeX 2.9\miktex\bin\texworks.exe"
+set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
+set wgetPath=%cd%\..\..\windows\creaTools_win_installers\CreaTools_v2_0_0_win32_installer\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
+  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
+  exit
+)
+
+if not exist %miktex% (
+ set miktex="%ProgramFilesPath_x64%\MiKTeX 2.9\miktex\bin\texworks.exe"
+ if not exist %miktex% (
+  echo ERROR!!! MiKTex has not been found in the system
+  exit
+ )
+)
+
+if not exist %wgetPath% (
+  echo ERROR!!! wget has not been found in the system
+  exit
+)
+
+
+set installpath=%thirdpartyGeneration%\thirdparty_install\%buildType%
+set binpath=%thirdpartyGeneration%\thirdparty_bin\%buildType%
+set sourcepath=%thirdpartyGeneration%\thirdparty_source\%buildType%
+
+set qt=Qt-4.7.3
+set buildWxWidgets28=1
+if %buildWxWidgets28%==1 set wxWidgets=wxWidgets-2.8.12
+if %buildWxWidgets28%==0 set wxWidgets=wxWidgets-2.9.2
+set boost=Boost-1.46.1
 set xercesc=xerces-c-3.1.1
 set itk=InsightToolkit-3.20.0
 set gdcm=gdcm
 set vtk=VTK
-rem ---End Setting Global Variables----
-call %vcvarsall%
 
-rmdir %binpath% /s /q
+set QTDIR=%sourcepath%\%qt%
+set WXDIR=%sourcepath%\%wxWidgets%
+set BOOSTDIR=%sourcepath%\%boost%
+set XERCESDIR=%sourcepath%\%xercesc%
+set ITKSRCDIR=%sourcepath%\%itk%
+set VTKSRCDIR=%sourcepath%\%VTK%
+set GDCMSRCDIR=%sourcepath%\%gdcm%
+
+echo -----------------------------------
+echo Environment variables Configuration
+echo -----------------------------------
+echo ThirdpartyGeneration=%thirdpartyGeneration%
+echo BuildType=%buildType%
+echo wget=%wgetPath%
+echo MikTex=%miktex%
+echo urlCreatis=%urlCreatisSource%
+echo 7zip=%zipPath%
+echo Visual Studio=%vcvarsall%
+echo InstallPath=%installpath%
+echo BinPath=%binpath%
+echo SourcePath=%sourcepath%
+echo QT=%qt%
+echo WX=%wxWidgets%
+echo BOOST=%boost%
+echo Xercesc=%xercesc%
+echo ITK=%itk%
+echo GDCM=%gdcm%
+echo VTK=%vtk%
+echo QTDIR=%QTDIR%
+echo WKDIR=%WXDIR%
+echo BOOSTDIR=%BOOSTDIR%
+echo XERCESDIR=%XERCESDIR%
+echo ITKSRCDIR=%ITKSRCDIR%
+echo VTKSRCDIR=%VTKSRCDIR%
+echo GDCMDIR=%GDCMSRCDIR%
+
+echo -----------------------------------
+echo ---End Setting Global Variables----
+echo -----------------------------------
+
+
+call %vcvarsall%
 
+echo -----------------------------------
+echo -------Creating Folders------------
+echo -----------------------------------
 
-rmdir %thirdpartyGeneration% /s /q
+rmdir /S /Q %thirdpartyGeneration%
 mkdir %thirdpartyGeneration%
 cd  %thirdpartyGeneration%
-mkdir thirdparty_source
-mkdir thirdparty_bin
-mkdir thirdparty_install
-
-rem --------Qt Installation------------
-rem -------Setting Variables-----------
-set QTDIR=%thirdpartyGeneration%\thirdparty_source\Qt\4.7.3\
-rem ----------Downloading--------------
-cd %thirdpartyGeneration%\thirdparty_source\
-md Qt\
-cd Qt\
+mkdir %sourcepath%
+mkdir %binpath%
+mkdir %installpath%
+
+
+echo ------End Creating Folders---------
+
+echo -----------------------------------
+echo ------Downloading Sources----------
+echo -----------------------------------
+
+cd %sourcepath%\
 %wgetPath% %urlCreatisSource%/qt-4.7.3.zip
-rem ----------Extracting---------------
-%zipPath% x qt-4.7.3.zip
-del qt-4.7.3.zip
-rem --------Renaming Folder------------
-rename qt-everywhere-opensource-src-4.7.3 4.7.3
-rem ----------Installing---------------
-cd 4.7.3
-echo y | configure -debug-and-release -opensource -shared -qt-sql-sqlite -phonon -phonon-backend -platform win32-msvc2010 -mp
+IF %buildWxWidgets28%==0 (
+  %wgetPath% %urlCreatisSource%/wxWidgets-2.9.2.7z
+) ELSE (
+  %wgetPath% %urlCreatisSource%/wxWidgets-2.8.12.tar.gz
+)
+%wgetPath% %urlCreatisSource%/boost_1_46_1.7z
+%wgetPath% %urlCreatisSource%/vtk-5.8.0.tar.gz
+%wgetPath% %urlCreatisSource%/InsightToolkit-3.20.0.zip
+%wgetPath% %urlCreatisSource%/gdcm_11_Oct_2011.tar.gz
+%wgetPath% %urlCreatisSource%/xerces-c-3.1.1.zip
+%wgetPath% %urlCreatisSource%/tth_exe.zip
+echo ------End Downloading Sources------
+echo -----------------------------------
+echo --------Qt Installation------------
+echo -----------------------------------
+echo ----------Extracting---------------
+
+cd %sourcepath%
+%zipPath% x %sourcepath%\qt-4.7.3.zip
+del %sourcepath%\qt-4.7.3.zip
+
+echo --------Renaming Folder------------
+
+rename qt-everywhere-opensource-src-4.7.3 %qt%
+
+echo ----------Installing---------------
+
+
+cd %QTDIR%
+
+echo y | configure -%buildType% -opensource -shared -qt-sql-sqlite -phonon -phonon-backend -platform win32-msvc2010 -mp
+
 nmake
 cd C:\
-rem ------End QT Installation----------
-rem -----wxWidgets Installation--------
-rem -------Setting Variables-----------
-set WXDIR=%thirdpartyGeneration%\thirdparty_source\wxWidgets\2.9.2\
-rem ----------Downloading--------------
-cd %thirdpartyGeneration%\thirdparty_source
-md wxWidgets\2.9.2
-cd wxWidgets\2.9.2
-%wgetPath% %urlCreatisSource%/wxWidgets-2.9.2.7z
-rem ----------Extracting---------------
-%zipPath% x wxWidgets-2.9.2.7z
-del wxWidgets-2.9.2.7z
-rem ----------Installing---------------
-cd %thirdpartyGeneration%\thirdparty_source\wxWidgets\2.9.2\build\msw
-nmake -f makefile.vc BUILD=debug UNICODE=1 SHARED=1
-nmake -f makefile.vc BUILD=release UNICODE=1 SHARED=1
+
+echo ------End QT Installation----------
+
+echo -----------------------------------
+echo -----wxWidgets Installation--------
+echo -----------------------------------
+echo ----------Extracting---------------
+
+cd %sourcepath%
+IF %buildWxWidgets28%==0 (
+  md %wxWidgets%
+  cd %wxWidgets%
+  %zipPath% x %sourcepath%\wxWidgets-2.9.2.7z
+  del %sourcepath%\wxWidgets-2.9.2.7z
+) ELSE (
+ %zipPath% x %sourcepath%\wxWidgets-2.8.12.tar.gz
+ %zipPath% x %sourcepath%\wxWidgets-2.8.12.tar
+ del %sourcepath%\wxWidgets-2.8.12.tar.gz
+ del %sourcepath%\wxWidgets-2.8.12.tar
+)
+echo ----------Installing---------------
+
+cd %sourcepath%\%wxWidgets%\build\msw
+IF %buildWxWidgets28%==0 (
+  nmake -f makefile.vc BUILD=%buildType% USE_OPENGL=1 USE_GUI=1 UNICODE=0 SHARED=1
+) ELSE (
+  nmake -f makefile.vc BUILD=%buildType% UNICODE=0 SHARED=1
+)
 cd C:\
-rem ----End wxWidgets Installation-----
-rem ------Boost Installation-----------
-rem -------Setting Variables-----------
-set BOOSTDIR=%thirdpartyGeneration%\thirdparty_source\Boost\1.47.0\
-rem ----------Downloading--------------
-cd %thirdpartyGeneration%\thirdparty_source\
-md Boost\
-cd Boost\
-%wgetPath% %urlCreatisSource%/boost_1_47_0.7z
-rem ----------Extracting---------------
-%zipPath% x boost_1_47_0.7z
-del boost_1_47_0.7z 
-rem --------Renaming Folder------------
-rename boost_1_47_0 1.47.0
-rem ----------Installing---------------
-cd %thirdpartyGeneration%\thirdparty_source\Boost\1.47.0\
-md boost-build
-cd tools\build\v2
+
+echo ----End wxWidgets Installation-----
+
+echo -----------------------------------
+echo ------Boost Installation-----------
+echo -----------------------------------
+echo ----------Extracting---------------
+
+cd %sourcepath%
+%zipPath% x %sourcepath%\boost_1_46_1.7z
+del %sourcepath%\boost_1_46_1.7z
+
+echo --------Renaming Folder------------
+
+rename boost_1_46_1 %boost%
+
+echo ----------Installing---------------
+
+mkdir %binpath%\%boost%Bin 
+mkdir %installpath%\%boost%
+
+cd %sourcepath%\%boost%
+
 call bootstrap.bat
-b2 -j 2 --build-dir=%thirdpartyGeneration%\thirdparty_source\Boost\1.47.0\boost-build toolset=msvc --build-type=msvc install --prefix=%thirdpartyGeneration%\thirdparty_source\Boost\1.47.0\boost-build
+bjam.exe --toolset=msvc-10.0 --build-type=complete --build-dir=%binpath%\%boost%Bin --link=shared --runtime-link=shared --prefix=%installpath%\%boost% install
 cd C:\
-rem -----End Boost Installation--------
-
-rem -------GDCM Installation-----------
-rem -------Setting Variables-----------
-rem ----------Downloading--------------
-cd %thirdpartyGeneration%\thirdparty_source
-%wgetPath% %urlCreatisSource%/gdcm_05_Mai_2011.tar.gz
-rem ----------Extracting---------------
-%zipPath% x gdcm_05_Mai_2011.tar.gz
-%zipPath% x gdcm_05_Mai_2011.tar
-del gdcm_05_Mai_2011.tar.gz
-del gdcm_05_Mai_2011.tar
-rem ----------Installing---------------
-cd  %binpath%
-mkdir %gdcm%Bin
-cd %gdcm%Bin
-cmake -G"Visual Studio 10"  -H%sourcepath%\%gdcm% -B%binpath%\%gdcm%Bin 
-cmake -D USE_DEBUG_LIB:BOOL=%buildType% -D CMAKE_INSTALL_PREFIX:PATH=%installpath%\%gdcm%\ CMakeCache.txt
-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
-cmake CMakeCache.txt
-FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%buildType%
-msbuild /p:Configuration=%buildType% INSTALL.vcxproj
-cd c:\
-rem -----End GDCM Installation---------
-rem -------VTK Installation------------
-rem ----------Downloading--------------
-mkdir %thirdpartyGeneration%\thirdparty_source\VTK
-cd %thirdpartyGeneration%\thirdparty_source\VTK
-%wgetPath% %urlCreatisSource%/vtk-5.6.1.zip
-rem ----------Extracting---------------
-%zipPath% x vtk-5.6.1.zip
-del vtk-5.6.1.zip
-rem ----------Installing---------------
+
+echo -----End Boost Installation--------
+
+echo -----------------------------------
+echo -------VTK Installation------------
+echo -----------------------------------
+echo ----------Extracting---------------
+
+cd %sourcepath%
+%zipPath% x %sourcepath%\VTK-5.8.0.tar.gz
+%zipPath% x %sourcepath%\VTK-5.8.0.tar
+cd %sourcepath%\VTK
+del %sourcepath%\VTK-5.8.0.tar.gz
+del %sourcepath%\VTK-5.8.0.tar
+
+echo ----------Installing---------------
+
+
 cd  %binpath%
 mkdir %vtk%Bin
 cd %vtk%Bin
@@ -141,37 +250,92 @@ cmake CMakeCache.txt
 FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%buildType%
 msbuild /p:Configuration=%buildType% INSTALL.vcxproj
 cd c:\
-rem ------End VTK Installation---------
-rem -------ITK Installation------------
-rem ----------Downloading--------------
-cd %thirdpartyGeneration%\thirdparty_source
-%wgetPath% %urlCreatisSource%/InsightToolkit-3.20.0.zip
-rem ----------Extracting---------------
+echo ------End VTK Installation---------
+
+echo -----------------------------------
+echo -------ITK Installation------------
+echo -----------------------------------
+echo ----------Extracting---------------
+
+cd %sourcepath%
 %zipPath% x InsightToolkit-3.20.0.zip
 del InsightToolkit-3.20.0.zip
-rem ----------Installing---------------
+
+echo ----------Installing---------------
+
 cd  %binpath%
 mkdir %itk%Bin
 cd %itk%Bin
-cmake -G"Visual Studio 10" -H%sourcepath%\%itk% -B%binpath%\%itk%Bin 
-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
-cmake -D USE_DEBUG_LIB:BOOL=%buildType% CMakeCache.txt
+cmake -G"Visual Studio 10" -H%sourcepath%\%itk% -B%binpath%\%itk%Bin
+cmake -D USE_DEBUG_LIB:BOOL=%buildType% -D CMAKE_INSTALL_PREFIX:PATH=%installpath%\%itk%\ CMakeCache.txt
+cmake -D BUILD_EXAMPLES:BOOL=OFF -D BUILD_TESTING:BOOL=OFF -D BUILD_SHARED_LIBS:BOOL=ON -D ITK_USE_REVIEW:BOOL=ON CMakeCache.txt
 cmake CMakeCache.txt
 FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%buildType%
 msbuild /p:Configuration=%buildType% INSTALL.vcxproj
 cd c:\
-rem ------End ITK Installation---------
-rem ------XERCES Installation----------
-rem ----------Downloading--------------
-cd %thirdpartyGeneration%\thirdparty_source
-%wgetPath% %urlCreatisSource%/xerces-c-3.1.1.zip
-rem ----------Extracting---------------
+
+echo ------End ITK Installation---------
+
+echo -----------------------------------
+echo ------XERCES Installation----------
+echo -----------------------------------
+echo ----------Extracting---------------
+
+cd %sourcepath%
 %zipPath% x xerces-c-3.1.1.zip
 del xerces-c-3.1.1.zip
-rem ----------Installing---------------
+
+echo ----------Installing---------------
+
 cd  %sourcepath%\%xercesc%\projects\Win32\VC10\xerces-all
+FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=build
+FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%buildType%
+msbuild /p:Configuration=%buildType% INSTALL.vcxproj
+
+echo -----End XERCES Installation-------
+
+
+
+echo -----------------------------------
+echo -------GDCM Installation-----------
+echo -----------------------------------
+echo ----------Extracting---------------
+
+cd %sourcepath%
+%zipPath% x gdcm_11_Oct_2011.tar.gz
+%zipPath% x gdcm_11_Oct_2011.tar
+del gdcm_11_Oct_2011.tar.gz
+del gdcm_11_Oct_2011.tar
+
+echo ----------Installing---------------
+
+
+cd  %binpath%
+mkdir %gdcm%Bin
+
+cd %gdcm%Bin
+cmake -G"Visual Studio 10"  -H%sourcepath%\%gdcm% -B%binpath%\%gdcm%Bin
+cmake -D USE_DEBUG_LIB:BOOL=%buildType% -D CMAKE_INSTALL_PREFIX:PATH=%installpath%\%gdcm%\ CMakeCache.txt
+cmake -D VTK_DIR:PATH=%installpath%\%vtk%\ -D GDCM_VTK:BOOL=ON -D BUILD_TESTING:BOOL=OFF -D GDCM_NAME_SPACE:STRING=gdcm13 CMakeCache.txt
+cmake CMakeCache.txt
 FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%buildType%
-REM msbuild /p:Configuration=%buildType% INSTALL.vcxproj
+msbuild /p:Configuration=%buildType% INSTALL.vcxproj
+cd c:\
+
+echo -----End GDCM Installation---------
+
+echo -----------------------------------
+echo -------TTH Installation------------
+echo -----------------------------------
+echo ----------Extracting---------------
+cd %sourcepath%
+%zipPath% x tth_exe.zip
+rename tth_exe tth
+del tth_exe.zip
+echo ------End TTH Installation---------
 cd c:\
-rem -----End XERCES Installation-------
-pause
+echo -----------------------------------
+echo ---End of Installing Libraries-----
+echo -----------------------------------
+
+exit /B
\ No newline at end of file