]> Creatis software - creaToolsTools.git/blob - Linux/scripts/ThirdParty-install_no_compile.sh
#2493 creaToolsTools Feature New Normal - Prepare and Install binary CreaTools...
[creaToolsTools.git] / Linux / scripts / ThirdParty-install_no_compile.sh
1 # ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
4 #                        pour la Santé)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 #
7 #  This software is governed by the CeCILL-B license under French law and 
8 #  abiding by the rules of distribution of free software. You can  use, 
9 #  modify and/ or redistribute the software under the terms of the CeCILL-B 
10 #  license as circulated by CEA, CNRS and INRIA at the following URL 
11 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
12 #  or in the file LICENSE.txt.
13 #
14 #  As a counterpart to the access to the source code and  rights to copy,
15 #  modify and redistribute granted by the license, users are provided only
16 #  with a limited warranty  and the software's author,  the holder of the
17 #  economic rights,  and the successive licensors  have only  limited
18 #  liability. 
19 #
20 #  The fact that you are presently reading this means that you have had
21 #  knowledge of the CeCILL-B license and that you accept its terms.
22 # ------------------------------------------------------------------------  
23
24
25 #!/bin/bash
26
27  if [ ! -f $PWD/scripts/CreaTools-configure.sh ]
28  then 
29    echo
30    echo "..ERROR.."
31    echo "==================================================="
32    echo "REMEMBER !"
33    echo ""
34    echo "YOU NEED TO RUN 'Configure' (0) First !"
35    echo "==================================================="
36    echo
37    echo
38    exit 0
39 fi
40
41 source $PWD/scripts/CreaTools-configure.sh
42
43    echo "------"
44    echo $PWD/scripts/CreaTools-configure.sh
45    echo --generationdir--
46    echo $generationdir
47    echo --corenumber--
48    echo $corenumber
49    echo --docgeneration--
50    echo $docgeneration
51    echo --installPrefix--
52    echo $installPrefix
53    echo --installPrefixThird--
54    echo $installPrefixThird
55    echo --buildType--
56    echo $buildType
57    echo --gdcmVersion--
58    echo $gdcmVersion
59    echo "--ETC_BASHRC--"
60    echo $ETC_BASHRC
61 #   echo --sourcesFrom--
62 #   echo $sourcesFrom
63 #   echo --scriptDir--
64 #   echo $scriptDir
65 #   echo --start_point--
66 #   echo $start_point
67    echo "------"
68
69 scriptDir=$PWD
70 sourcesDir=$generationdir/thirdparty_sources
71 binDir=$generationdir/thirdparty_bin
72
73 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
74 then
75    rm $installPrefixThird/share/creatools_third_party_library_config.sh
76 fi
77
78 if [ ! -e $installPrefixThird/share ]
79 then
80    mkdir -p $installPrefixThird/share
81 fi
82 touch     $installPrefixThird/share/creatools_third_party_library_config.sh
83 chmod 755 $installPrefixThird/share/creatools_third_party_library_config.sh
84
85 echo export PATH='$'PATH:$installPrefixThird/bin           >> $installPrefixThird/share/creatools_third_party_library_config.sh
86 echo export VTK_DIR=$installPrefixThird/lib/vtk-5.6        >> $installPrefixThird/share/creatools_third_party_library_config.sh
87 if [ $ITKVersion = ITK3 ]
88 then
89    echo export ITK_DIR=$installPrefixThird/lib/InsightToolkit >> $installPrefixThird/share/creatools_third_party_library_config.sh
90 else
91    echo export ITK_DIR=$installPrefixThird/lib/               >> $installPrefixThird/share/creatools_third_party_library_config.sh
92 fi
93 echo export GDCM_DIR=$installPrefixThird/lib/gdcm          >> $installPrefixThird/share/creatools_third_party_library_config.sh
94 echo export TTH=$installPrefixThird/bin/tth                >> $installPrefixThird/share/creatools_third_party_library_config.sh
95
96 if [ $OperatingSystem = "MacOS" ]
97 then
98    echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$GDCM_DIR   >> $installPrefixThird/share/creatools_third_party_library_config.sh
99    echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$ITK_DIR    >> $installPrefixThird/share/creatools_third_party_library_config.sh
100    echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$VTK_DIR    >> $installPrefixThird/share/creatools_third_party_library_config.sh
101 else
102    echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$GDCM_DIR   >> $installPrefixThird/share/creatools_third_party_library_config.sh
103    echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$ITK_DIR    >> $installPrefixThird/share/creatools_third_party_library_config.sh
104    echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$VTK_DIR    >> $installPrefixThird/share/creatools_third_party_library_config.sh
105 fi
106
107 export VTK_DIR=$installPrefixThird/lib/vtk-5.6
108 if [ $ITKVersion = ITK3 ]
109 then
110    export ITK_DIR=$installPrefixThird/lib/InsightToolkit
111 else
112    export ITK_DIR=$installPrefixThird/lib/
113 fi
114
115 export GDCM_DIR=$installPrefixThird/lib/gdcm
116 export TTH=$installPrefixThird/bin/tth
117
118    sed -i -e '/.*installPrefixThird*/ d' $ETC_BASHRC
119    sed -i -e '/.*creatools_third_party_library_config.*/ d' $ETC_BASHRC
120
121 # - add line 'bash $installPrefixThird/share/creatools_third_party_library_config.sh' (with accurate value for ???)
122 echo installPrefixThird=$installPrefixThird >> $ETC_BASHRC
123 echo '[ -f "$installPrefixThird/share/creatools_third_party_library_config.sh" ] &&  source $installPrefixThird/share/creatools_third_party_library_config.sh' >> $ETC_BASHRC