]> Creatis software - creaToolsTools.git/blob - Linux/scripts/ThirdParty-install-Finalize.sh
Fix comment;
[creaToolsTools.git] / Linux / scripts / ThirdParty-install-Finalize.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 echo "=================================== in ThirdParty-install-Finalize.sh ETC_BASHRC : " $ETC_BASHRC
19
20 # /// \TODO move theese ones upper in the process!  JPR
21
22 export GDCM_DIR=$installPrefixThird/lib/gdcm/
23 export VTK_DIR=$installPrefixThird/lib/vtk-5.6/
24 export ITK_DIR=$installPrefixThird/lib/InsightToolkit/
25
26
27 #deal with create creatools_third_party_libraries_config.sh
28 echo "=========================================================installPrefixThird "$installPrefixThird
29 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
30 then
31    rm $installPrefixThird/share/creatools_third_party_library_config.sh
32 fi
33
34 if [ ! -e $installPrefixThird/share ]
35 then
36    mkdir $installPrefixThird/share
37 fi
38 touch     $installPrefixThird/share/creatools_third_party_library_config.sh
39 chmod 755 $installPrefixThird/share/creatools_third_party_library_config.sh
40
41 echo export PATH='$'PATH:$installPrefixThird/bin           >> $installPrefixThird/share/creatools_third_party_library_config.sh
42 echo export VTK_DIR=$installPrefixThird/lib/vtk-5.6        >> $installPrefixThird/share/creatools_third_party_library_config.sh
43 echo export ITK_DIR=$installPrefixThird/lib/InsightToolkit >> $installPrefixThird/share/creatools_third_party_library_config.sh
44 echo export GDCM_DIR=$installPrefixThird/lib/gdcm          >> $installPrefixThird/share/creatools_third_party_library_config.sh
45 echo export TTH=$installPrefixThird/bin/tth                >> $installPrefixThird/share/creatools_third_party_library_config.sh
46
47 if [ $OperatingSystem = "MacOS" ]
48 then
49    echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$GDCM_DIR   >> $installPrefixThird/share/creatools_third_party_library_config.sh
50    echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$ITK_DIR    >> $installPrefixThird/share/creatools_third_party_library_config.sh
51    echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$VTK_DIR    >> $installPrefixThird/share/creatools_third_party_library_config.sh
52 else
53    echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$GDCM_DIR   >> $installPrefixThird/share/creatools_third_party_library_config.sh
54    echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$ITK_DIR    >> $installPrefixThird/share/creatools_third_party_library_config.sh
55    echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$VTK_DIR    >> $installPrefixThird/share/creatools_third_party_library_config.sh
56 fi
57
58    sed -i -e '/.*installPrefixThird*/ d' $ETC_BASHRC
59    sed -i -e '/.*creatools_third_party_library_config.*/ d' $ETC_BASHRC
60
61
62 # - add line 'bash $installPrefixThird/share/creatools_third_party_library_config.sh' (with accurate value for ???)
63
64 echo "====================================================ETC_BASHRC "  $ETC_BASHRC 
65 echo installPrefixThird=$installPrefixThird >> $ETC_BASHRC
66 echo '[ -f "$installPrefixThird/share/creatools_third_party_library_config.sh" ] &&  source $installPrefixThird/share/creatools_third_party_library_config.sh' >> $ETC_BASHRC 
67
68
69 chown -R $loginUserName  $generationdir
70 chgrp -R $loginGroupName $generationdir