]> Creatis software - creaToolsTools.git/blob - Linux/scripts/ThirdParty-install-ITK.sh
Fix mistyping
[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  fi
58
59 if [ $buildType = "Debug" ]
60 then
61    debug="ON"
62 else
63    debug="OFF"
64 fi
65
66 # the following stupid test is used at debug time; Please don't remove!
67 #if [ true = false ]
68 if [ true = true ]
69 then
70   libname=InsightToolkit-3.20.0
71   dirInstall=$binDir/$libname-Bin
72   export ITK_DIR=$installPrefixThird/lib/InsightToolkit/
73   mkdir $dirInstall
74   cd $dirInstall
75   cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
76   ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
77   cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefixThird CMakeCache.txt
78   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
79   #uncomment following line if you want to use the bleeding edge of GDCM2!
80   #cmake -D ITK_USE_SYSTEM_GDCM:BOOL=ON CMakeCache.txt
81   cmake CMakeCache.txt
82   make -j $corenumber
83   make install
84   cd ..
85 fi
86