]> Creatis software - creaToolsTools.git/blob - Linux/scripts/ThirdParty-install-ITK.sh
missing tar
[creaToolsTools.git] / Linux / scripts / ThirdParty-install-ITK.sh
1 #!/bin/bash
2
3  if [ ! -f $PWD/scripts/CreaTools-configure.sh ]
4  then 
5    echo
6    echo "..ERROR.."
7    echo "==================================================="
8    echo "REMEMBER !"
9    echo ""
10    echo "YOU NEED TO RUN 'Configure' (0) First !"
11    echo "==================================================="
12    echo
13    echo
14    exit 0
15 fi
16
17 source $PWD/scripts/CreaTools-configure.sh
18
19 scriptDir=$PWD
20 sourcesDir=$generationdir/thirdparty_sources
21 binDir=$generationdir/thirdparty_bin
22
23 if [ ! -e $generationdir ]
24 then
25    mkdir $generationdir
26    chown $loginUserName  $generationdir
27    chgrp $loginGroupName $generationdir
28
29 fi
30 if [ ! -e $sourcesDir ]
31 then
32    mkdir $sourcesDir
33    #was : (pb on MacOS?)
34    #chown $loginUserName:$loginGroupName $sourcesDir
35    chown $loginUserName  $sourcesDir
36    chgrp $loginGroupName $sourcesDir
37 fi
38
39 if [ ! -e $binDir ]
40 then
41    mkdir $binDir
42    chown $loginUserName  $binDir
43    chgrp $loginGroupName $binDir
44 fi
45
46   echo "we remove old stuff"
47   rm -rf $sourcesDir/InsightToolkit*
48
49  cd $sourcesDir
50
51  if [ $OperatingSystem = "MacOS" ]
52    then
53     curl -O http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/InsightToolkit-3.20.0.tar.gz    # MacOS, clever enough to understand it *has* to uncompress, doesn't understand tar -z :-(
54     tar -xvf InsightToolkit-3.20.0.tar.gz
55    else
56     wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/InsightToolkit-3.20.0.tar.gz
57     tar -xzvf InsightToolkit-3.20.0.tar.gz    
58  fi
59
60 if [ $buildType = "Debug" ]
61 then
62    debug="ON"
63 else
64    debug="OFF"
65 fi
66
67 # the following stupid test is used at debug time; Please don't remove!
68 #if [ true = false ]
69 if [ true = true ]
70 then
71   libname=InsightToolkit-3.20.0
72   dirInstall=$binDir/$libname-Bin
73   export ITK_DIR=$installPrefixThird/lib/InsightToolkit/
74   mkdir $dirInstall
75   cd $dirInstall
76   cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
77   ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
78   cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefixThird CMakeCache.txt
79   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
80   #uncomment following line if you want to use the bleeding edge of GDCM2!
81   #cmake -D ITK_USE_SYSTEM_GDCM:BOOL=ON CMakeCache.txt
82   cmake CMakeCache.txt
83   make -j $corenumber
84   make install
85   cd ..
86 fi
87