]> Creatis software - creaToolsTools.git/blob - Linux/scripts/ThirdParty-install-gdcm.sh
ed672c3613904c907fd3cddf5bb537d0e2727ee7
[creaToolsTools.git] / Linux / scripts / ThirdParty-install-gdcm.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    echo "------"
20    echo $PWD/scripts/CreaTools-configure.sh
21    echo --generationdir--
22    echo $generationdir
23    echo --docgeneration--
24    echo $docgeneration
25    echo --installPrefix--
26    echo $installPrefix
27    echo --installPrefixThird--
28    echo $installPrefixThird
29    echo --buildType--
30    echo $buildType
31    echo --gdcmVersion--
32    echo $gdcmVersion
33 #   echo --sourcesFrom--
34 #   echo $sourcesFrom
35 #   echo --scriptDir--
36 #   echo $scriptDir
37 #   echo --start_point--
38 #   echo $start_point
39    echo "------"
40
41
42 scriptDir=$PWD
43 sourcesDir=$generationdir/thirdparty_sources
44 binDir=$generationdir/thirdparty_bin
45
46 if [ ! -e $generationdir ]
47 then
48    mkdir $generationdir
49    chown $loginUserName  $generationdir
50    chgrp $loginGroupName $generationdir
51
52 fi
53 if [ ! -e $sourcesDir ]
54 then
55    mkdir $sourcesDir
56    #was : (pb on MacOS?)
57    #chown $loginUserName:$loginGroupName $sourcesDir
58    chown $loginUserName  $sourcesDir
59    chgrp $loginGroupName $sourcesDir
60 fi
61
62 if [ ! -e $binDir ]
63 then
64    mkdir $binDir
65    chown $loginUserName  $binDir
66    chgrp $loginGroupName $binDir
67 fi
68
69   echo "we remove old stuff"
70   rm -rf $sourcesDir/gdcm*
71   rm -rf $binDir/gdcm*
72
73   cd $sourcesDir
74
75   echo "we download new stuff"
76  if [ $OperatingSystem = "MacOS" ]
77  then
78   curl -O http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/gdcm_05_Mai_2011.tar.gz
79   # MacOS, clever enough to understand it *has* to uncompress, doesn't understand tar -z :-(
80   tar -xvf gdcm_05_Mai_2011.tar.gz
81  else
82   wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/gdcm_05_Mai_2011.tar.gz
83   tar -xvzf gdcm_05_Mai_2011.tar.gz
84  fi
85
86 if [ $buildType = "Debug" ]
87 then
88    debug="ON"
89 else
90    debug="OFF"
91 fi
92
93 # the following stupid test is used at debug time; Please don't remove!
94 #if [ true = false ]
95 if [ true = true ]
96 then
97   libname=gdcm
98   dirInstall=$binDir/$libname-Bin
99   export GDCM_DIR=$installPrefixThird/lib/gdcm/
100   mkdir $dirInstall
101   cd $dirInstall
102
103   cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
104   ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
105   cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefixThird CMakeCache.txt
106   cmake -D VTK_DIR:PATH=$dirInstallVTK CMakeCache.txt
107   cmake -D GDCM_VTK:BOOL=ON -D GDCM_NAME_SPACE:STRING=gdcm13 CMakeCache.txt
108   make -j $corenumber
109   make install
110   cd ..
111 fi
112
113 #if [ true = false ]
114 if [ true = true ]
115 then
116   cd $sourcesDir
117   cp tth $installPrefixThird/bin
118 fi
119
120
121 # deal with create creatools_third_party_libraries_config.sh
122 # is now done in ThirdParty-install-Finalize.sh
123