]> Creatis software - creaToolsTools.git/blob - Linux/scripts/ThirdParty-install-Finalize.sh
#3405 creaToolsTools Feature New Normal - vtk8itk5wx3-macos
[creaToolsTools.git] / Linux / scripts / ThirdParty-install-Finalize.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 echo "=================================== in ThirdParty-install-Finalize.sh ETC_BASHRC : " $ETC_BASHRC
43
44 # /// \TODO move theese ones upper in the process!  JPR
45
46 export GDCM_DIR=$installPrefixThird/lib/gdcm/
47 export VTK_DIR=$installPrefixThird/lib/cmake/vtk-8.1/
48 export ITK_DIR=$installPrefixThird/lib
49 export WT_DIR=$installPrefixThird/lib/wt-4.0.4-rc1/
50
51 baseLibraryThirdPartyDir=$installPrefixThird/share/creatools
52
53
54 #deal with create creatools_third_party_libraries_config.sh
55 echo "=========================================================installPrefixThird "$installPrefixThird
56 if [ -f $baseLibraryThirdPartyDir/creatools_third_party_library_config.sh ]
57 then
58    rm $baseLibraryThirdPartyDir/creatools_third_party_library_config.sh
59 fi
60
61 if [ ! -e $baseLibraryThirdPartyDir ]
62 then
63    mkdir -p $baseLibraryThirdPartyDir
64 fi
65 touch     $baseLibraryThirdPartyDir/creatools_third_party_library_config.sh
66 chmod 755 $baseLibraryThirdPartyDir/creatools_third_party_library_config.sh
67
68 echo export GDK_BACKEND=x11                                                             >> $baseLibraryThirdPartyDir/creatools_third_party_library_config.sh
69 echo export MESA_GL_VERSION_OVERRIDE=3.2                                >> $baseLibraryThirdPartyDir/creatools_third_party_library_config.sh
70 echo installPrefixThird='$1'                                                                    >> $baseLibraryThirdPartyDir/creatools_third_party_library_config.sh
71 echo export PATH='$'PATH:'$'installPrefixThird/bin                      >> $baseLibraryThirdPartyDir/creatools_third_party_library_config.sh
72 echo export VTK_DIR='$'installPrefixThird/lib                           >> $baseLibraryThirdPartyDir/creatools_third_party_library_config.sh
73 echo export ITK_DIR='$'installPrefixThird/lib                                   >> $baseLibraryThirdPartyDir/creatools_third_party_library_config.sh
74 echo export GDCM_DIR='$'installPrefixThird/lib/gdcm             >> $baseLibraryThirdPartyDir/creatools_third_party_library_config.sh
75 echo export WT_DIR='$'installPrefixThird/lib/wt-4.0.4-rc1       >> $baseLibraryThirdPartyDir/creatools_third_party_library_config.sh
76 echo export TTH='$'installPrefixThird/bin/tth                   >> $baseLibraryThirdPartyDir/creatools_third_party_library_config.sh
77
78 if [ $OperatingSystem = "MacOS" ]
79 then
80    echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:'$'GDCM_DIR   >> $baseLibraryThirdPartyDir/creatools_third_party_library_config.sh
81    echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:'$'ITK_DIR    >> $baseLibraryThirdPartyDir/creatools_third_party_library_config.sh
82    echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:'$'VTK_DIR    >> $baseLibraryThirdPartyDir/creatools_third_party_library_config.sh
83    echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:'$'WT_DIR         >> $baseLibraryThirdPartyDir/creatools_third_party_library_config.sh
84 else
85    echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:'$'GDCM_DIR           >> $baseLibraryThirdPartyDir/creatools_third_party_library_config.sh
86    echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:'$'ITK_DIR            >> $baseLibraryThirdPartyDir/creatools_third_party_library_config.sh
87    echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:'$'VTK_DIR            >> $baseLibraryThirdPartyDir/creatools_third_party_library_config.sh
88    echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:'$'WT_DIR             >> $baseLibraryThirdPartyDir/creatools_third_party_library_config.sh
89 fi
90
91 cd $PWD/scripts
92 source ThirdParty-bashrc.sh
93 chown -R $loginUserName  $generationdir
94 chgrp -R $loginGroupName $generationdir
95 source $ETC_BASHRC 
96
97 ## copping files to prepare the package Intall-Creatools-Bin.sh
98 cp ThirdParty-bashrc.sh $baseLibraryThirdPartyDir/.
99 cp ThirdParty-install-Base-Stuff.sh $baseLibraryThirdPartyDir/.
100 cp ThirdParty-install-Base-rpm.sh $baseLibraryThirdPartyDir/.
101
102