]> Creatis software - creaToolsTools.git/blob - Linux/scripts/ThirdParty-install-gdcm.sh
missing tar
[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 # the following stupid test is used at debug time; Please don't remove!
70 #if [ true = false ]
71 if [ true = true ]
72 then
73
74   rm -rf $sourcesDir/gdcm*
75
76   rm -rf $binDir/gdcm*
77
78   cd $sourcesDir
79
80  if [ $OperatingSystem = "MacOS" ]
81  then
82   curl http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/gdcm_05_Mai_2011.tar.gz
83   tar -xvf gdcm_05_Mai_2011.tar.gz   
84  else
85   wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/gdcm_05_Mai_2011.tar.gz 
86   tar -xvzf gdcm_05_Mai_2011.tar.gz
87  fi
88
89 fi
90
91 if [ $buildType = "Debug" ]
92 then
93    debug="ON"
94 else
95    debug="OFF"
96 fi
97
98 # the following stupid test is used at debug time; Please don't remove!
99 #if [ true = false ]
100 if [ true = true ]
101 then
102   libname=gdcm
103   dirInstall=$binDir/$libname-Bin
104   export GDCM_DIR=$installPrefixThird/lib/gdcm/
105   mkdir $dirInstall
106   cd $dirInstall
107   cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
108   ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
109   cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefixThird CMakeCache.txt
110   cmake -D VTK_DIR:PATH=$dirInstallVTK CMakeCache.txt
111   cmake -D GDCM_VTK:BOOL=ON -D GDCM_NAME_SPACE:STRING=gdcm13 CMakeCache.txt
112   make -j 2
113   make install
114   cd ..
115 fi
116
117 #if [ true = false ]
118 if [ true = true ]
119 then
120   cd $sourcesDir
121   cp tth $installPrefixThird/bin
122 fi
123
124
125 # deal with create creatools_third_party_libraries_config.sh
126 # is now done in ThirdParty-install-Finalize.sh
127