2 if [ ! -f $PWD/scripts/CreaTools-configure.sh ]
6 echo "==================================================="
9 echo "YOU NEED TO RUN 'Configure' (0) First !"
10 echo "==================================================="
17 source $PWD/scripts/CreaTools-configure.sh
20 echo $PWD/scripts/CreaTools-configure.sh
21 echo --generationdir--
25 echo --docgeneration--
27 echo --installPrefix--
29 echo --installPrefixThird--
30 echo $installPrefixThird
35 # echo --sourcesFrom--
39 # echo --start_point--
45 sourcesDir=$generationdir/thirdparty_sources
46 binDir=$generationdir/thirdparty_bin
48 if [ ! -e $generationdir ]
51 chown $loginUserName $generationdir
52 chgrp $loginGroupName $generationdir
55 if [ ! -e $sourcesDir ]
59 #chown $loginUserName:$loginGroupName $sourcesDir
60 chown $loginUserName $sourcesDir
61 chgrp $loginGroupName $sourcesDir
67 chown $loginUserName $binDir
68 chgrp $loginGroupName $binDir
72 # the following stupid test is used at debug time; Please don't remove!
76 # ///\TODO what about SuSE? Debian? Mandriva? Gentoo?
77 case "$OperatingSystem" in
80 yum install cmake-gui -y
81 yum install doxygen -y
82 yum install graphviz -y
83 yum install texlive -y
84 yum install latex2html -y
85 yum install wxGTK-devel wxBase -y
86 yum install boost-devel -y
87 yum install sqlite-devel -y
88 yum install qt-devel -y
89 yum install mesa-libOSMesa-devel -y
92 apt-get --yes install build-essential # esta linea instala las librerias necesarias para compilar en ubuntu, g++ gcc etc etc etc.
93 apt-get --yes install cmake
94 apt-get --yes install cmake-gui
95 apt-get --yes install cmake-curses-gui
96 apt-get --yes install doxygen
97 apt-get --yes install graphviz
98 apt-get --yes install texlive
99 apt-get --yes install latex2html
100 apt-get --yes install libgtk2.0-dev #GTK
101 apt-get --yes install libwxgtk2.8-dev #Wx GTK
102 apt-get --yes install libwxbase2.8-dev #Wx solito
103 apt-get --yes install libboost-dev #Boost
104 apt-get --yes install libboost-all-dev #Boost
105 apt-get --yes install libqt4-dev #QT4
106 apt-get --yes install sqlite
107 apt-get --yes install libsqlite0-dev
108 apt-get --yes install libosmesa6-dev #Mesa6
109 apt-get --yes install uuid-dev # uuid para la instalacion de itk
110 apt-get --yes install libxaw7-dev # X11
115 port install cmake -y
116 port install cmake-gui -y
117 port install doxygen -y
118 port install graphviz -y
119 port install texlive -y
120 port install latex2html -y
121 port install wxGTK-devel wxBase -y
122 port install boost-devel -y
123 port install sqlite-devel -y
124 port install qt-devel -y
125 port install mesa-libOSMesa-devel -y
128 #echo " '$OperatingSystem' : Unknown (for us...) Operating Sytem "
129 echo " Allowed values are (right now) Fedora, Ubuntu, MacOS "
137 # the following stupid test is used at debug time; Please don't remove!
141 rm -rf $sourcesDir/VTK*
142 rm -rf $sourcesDir/vtk*
143 rm -rf $sourcesDir/InsightToolkit*
144 rm -rf $sourcesDir/gdcm*
145 rm -rf $sourcesDir/tth*
148 rm -rf $binDir/InsightToolkit*
152 if [ $OperatingSystem = "MacOS" ]
154 curl http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/VTK-5.6.1.patchCreatis.tar.gz
155 curl http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/gdcm_05_Mai_2011.tar.gz
156 curl http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/InsightToolkit-3.20.0.tar.gz
157 curl http://www.creatis.insa-lyon.fr/software/public/creatools/crea_Developer_Tools/All_Versions/tth/tth_linux/tth
159 wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/VTK-5.6.1.patchCreatis.tar.gz
160 wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/gdcm_05_Mai_2011.tar.gz
161 wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/InsightToolkit-3.20.0.tar.gz
162 wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_Developer_Tools/All_Versions/tth/tth_linux/tth
164 tar -xvzf VTK-5.6.1.patchCreatis.tar.gz
165 tar -xvzf gdcm_05_Mai_2011.tar.gz
166 tar -xvzf InsightToolkit-3.20.0.tar.gz
172 if [ $buildType = "Debug" ]
180 # the following stupid test is used at debug time; Please don't remove!
185 dirInstall=$binDir/$libname-Bin
186 dirInstallVTK=$dirInstall
187 export VTK_DIR=$installPrefixThird/lib/vtk-5.6/
191 cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
192 ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
193 cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefixThird CMakeCache.txt
194 cmake -D BUILD_EXAMPLES:BOOL=OFF -D BUILD_TESTING:BOOL=OFF -D BUILD_SHARED_LIBS:BOOL=ON -D VTK_USE_QT:BOOL=ON CMakeCache.txt
201 # the following stupid test is used at debug time; Please don't remove!
206 dirInstall=$binDir/$libname-Bin
207 export GDCM_DIR=$installPrefixThird/lib/gdcm/
210 cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
211 ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
212 cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefixThird CMakeCache.txt
213 cmake -D VTK_DIR:PATH=$dirInstallVTK CMakeCache.txt
214 cmake -D GDCM_VTK:BOOL=ON -D GDCM_NAME_SPACE:STRING=gdcm13 CMakeCache.txt
220 # the following stupid test is used at debug time; Please don't remove!
224 libname=InsightToolkit-3.20.0
225 dirInstall=$binDir/$libname-Bin
226 export ITK_DIR=$installPrefixThird/lib/InsightToolkit/
229 cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
230 ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
231 cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefixThird CMakeCache.txt
232 cmake -D BUILD_EXAMPLES:BOOL=OFF -D BUILD_TESTING:BOOL=OFF -D BUILD_SHARED_LIBS:BOOL=ON -D ITK_USE_REVIEW:BOOL=ON CMakeCache.txt
233 #uncomment following line if you want to use the bleeding edge of GDCM2!
234 #cmake -D ITK_USE_SYSTEM_GDCM:BOOL=ON CMakeCache.txt
245 # pourquoi ne copie-t-on plus? JPR
246 # cp tth $installPrefixThird/bin
250 #deal with create creatools_third_party_libraries_config.sh
252 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
254 rm $installPrefixThird/share/creatools_third_party_library_config.sh
257 if [ ! -e $installPrefixThird/share ]
259 mkdir $installPrefixThird/share
261 touch $installPrefixThird/share/creatools_third_party_library_config.sh
262 chmod 755 $installPrefixThird/share/creatools_third_party_library_config.sh
264 echo export PATH='$'PATH:$installPrefixThird/bin >> $installPrefixThird/share/creatools_third_party_library_config.sh
265 echo export VTK_DIR=$installPrefixThird/lib/vtk-5.6 >> $installPrefixThird/share/creatools_third_party_library_config.sh
266 echo export ITK_DIR=$installPrefixThird/lib/InsightToolkit >> $installPrefixThird/share/creatools_third_party_library_config.sh
267 echo export GDCM_DIR=$installPrefixThird/lib/gdcm >> $installPrefixThird/share/creatools_third_party_library_config.sh
268 echo export TTH=$installPrefixThird/bin/tth >> $installPrefixThird/share/creatools_third_party_library_config.sh
269 if [ $OperatingSystem = "MacOS" ]
271 echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$GDCM_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh
272 echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$ITK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh
273 echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$VTK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh
275 echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$GDCM_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh
276 echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$ITK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh
277 echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$VTK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh
281 # - remove line 'bash $installPrefixThird/share/creatools_third_party_library_config.sh' if any (with accurate value for ???)
283 # Install creatools as user (no longer as root) // JPR 2/5/2011
284 #if [ ! -f /etc/bashrc ]
286 # export ETC_BASHRC="/etc/bash.bashrc"
288 # export ETC_BASHRC="/etc/bashrc"
291 case "$OperatingSystem" in
293 export ETC_BASHRC=$HOME/.bashrc
296 export ETC_BASHRC=$HOME/.bashrc
299 export ETC_BASHRC=$HOME/.profile
304 sed -i -e '/.*installPrefixThird*/ d' $ETC_BASHRC
305 sed -i -e '/.*creatools_third_party_library_config.*/ d' $ETC_BASHRC
308 # - add line 'bash $installPrefixThird/share/creatools_third_party_library_config.sh' (with accurate value for ???)
309 echo installPrefixThird=$installPrefixThird >> $ETC_BASHRC
310 echo '[ -f "$installPrefixThird/share/creatools_third_party_library_config.sh" ] && source $installPrefixThird/share/creatools_third_party_library_config.sh' >> $ETC_BASHRC
312 chown -R $loginUserName $generationdir
313 chgrp -R $loginGroupName $generationdir