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