]> Creatis software - creaToolsTools.git/blob - Linux/scripts/ThirdParty-install-gdcm.sh
Use elementary steps
[creaToolsTools.git] / Linux / scripts / ThirdParty-install-gdcm.sh
1 #!/bin/bash
2  if [ ! -f $PWD/scripts/CreaTools-configure.sh ]
3  then 
4    echo
5    echo "..ERROR.."
6    echo "==================================================="
7    echo "REMEMBER !"
8    echo ""
9    echo "YOU NEED TO RUN 'Configure' (0) First !"
10    echo "==================================================="
11    echo
12    echo
13    exit 0
14 fi 
15
16 source $PWD/scripts/CreaTools-configure.sh
17
18    echo "------"
19    echo $PWD/scripts/CreaTools-configure.sh
20    echo --generationdir--
21    echo $generationdir
22    echo --docgeneration--
23    echo $docgeneration
24    echo --installPrefix--
25    echo $installPrefix
26    echo --installPrefixThird--
27    echo $installPrefixThird
28    echo --buildType--
29    echo $buildType
30    echo --gdcmVersion--
31    echo $gdcmVersion
32 #   echo --sourcesFrom--
33 #   echo $sourcesFrom
34 #   echo --scriptDir--
35 #   echo $scriptDir
36 #   echo --start_point--
37 #   echo $start_point
38    echo "------"
39
40
41 scriptDir=$PWD
42 sourcesDir=$generationdir/thirdparty_sources
43 binDir=$generationdir/thirdparty_bin
44
45 if [ ! -e $generationdir ]
46 then
47    mkdir $generationdir
48    chown $loginUserName:$loginGroupName $generationdir
49 fi
50 if [ ! -e $sourcesDir ]
51 then
52    mkdir $sourcesDir
53 fi
54
55 if [ ! -e $binDir ]
56 then
57    mkdir $binDir
58 fi
59
60
61 # the following stupid test is used at debug time; Please don't remove!
62 #if [ true = false ]
63 if [ true = true ]
64 then
65
66   rm -rf $sourcesDir/gdcm*
67
68   rm -rf $binDir/gdcm*
69
70   cd $sourcesDir
71   
72  if [ $OperatingSystem = "MacOS" ]
73  then      
74   curl http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/gdcm_05_Mai_2011.tar.gz 
75  else  
76   wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/gdcm_05_Mai_2011.tar.gz
77  fi
78  
79   tar -xvzf gdcm_05_Mai_2011.tar.gz
80
81 fi
82
83
84 if [ $buildType = "Debug" ]
85 then
86    debug="ON"
87 else
88    debug="OFF"
89 fi
90
91
92 # the following stupid test is used at debug time; Please don't remove!
93 #if [ true = false ]
94 if [ true = true ]
95 then
96   libname=gdcm
97   dirInstall=$binDir/$libname-Bin
98   export GDCM_DIR=$installPrefixThird/lib/gdcm/
99   mkdir $dirInstall
100   cd $dirInstall
101   cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
102   ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
103   cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefixThird CMakeCache.txt
104   cmake -D VTK_DIR:PATH=$dirInstallVTK CMakeCache.txt
105   cmake -D GDCM_VTK:BOOL=ON -D GDCM_NAME_SPACE:STRING=gdcm13 CMakeCache.txt
106   make -j 2
107   make install
108   cd ..
109 fi
110
111 #if [ true = false ]
112 if [ true = true ]
113 then
114   cd $sourcesDir
115   cp tth $installPrefixThird/bin
116 fi
117
118
119 # deal with create creatools_third_party_libraries_config.sh
120 # is now done in ThirdParty-install-Finalize.sh
121