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:$loginGroupName $generationdir
53 if [ ! -e $sourcesDir ]
64 # the following stupid test is used at debug time; Please don't remove!
69 case "$OperatingSystem" in
72 yum install cmake-gui -y
73 yum install doxygen -y
74 yum install graphviz -y
75 yum install texlive -y
76 yum install latex2html -y
77 yum install wxGTK-devel wxBase -y
78 yum install boost-devel -y
79 yum install sqlite-devel -y
80 yum install qt-devel -y
81 yum install mesa-libOSMesa-devel -y
84 apt-get --yes install build-essential # esta linea instala las librerias necesarias para compilar en ubuntu, g++ gcc etc etc etc.
85 apt-get --yes install cmake
86 apt-get --yes install cmake-gui
87 apt-get --yes install cmake-curses-gui
88 apt-get --yes install doxygen
89 apt-get --yes install graphviz
90 apt-get --yes install texlive
91 apt-get --yes install latex2html
92 apt-get --yes install libgtk2.0-dev #GTK
93 apt-get --yes install libwxgtk2.8-dev #Wx GTK
94 apt-get --yes install libwxbase2.8-dev #Wx solito
95 apt-get --yes install libboost-dev #Boost
96 apt-get --yes install libboost-all-dev #Boost
97 apt-get --yes install libqt4-dev #QT4
98 apt-get --yes install sqlite
99 apt-get --yes install libsqlite0-dev
100 apt-get --yes install libosmesa6-dev #Mesa6
101 apt-get --yes install uuid-dev # uuid para la instalacion de itk
102 apt-get --yes install libxaw7-dev # X11
105 # QUESTION : is -y mandatory?
107 port install cmake -y
108 port install doxygen -y
109 port install graphviz -y
110 port install texlive -y
111 port install latex2html -y
112 port install wxGTK -y
113 port install boost -y
114 port install sqlite3 -y
115 port install qt4-mac -y
119 #echo " '$OperatingSystem' : Unknown (for us...) Operating Sytem "
120 echo " Allowed values are (right now) Fedora, Ubuntu, MacOS "
128 # the following stupid test is used at debug time; Please don't remove!
132 rm -rf $sourcesDir/VTK*
133 rm -rf $sourcesDir/vtk*
134 rm -rf $sourcesDir/InsightToolkit*
135 rm -rf $sourcesDir/gdcm*
136 rm -rf $sourcesDir/tth*
139 rm -rf $binDir/InsightToolkit*
142 if [ $OperatingSystem = "MacOS" ]
144 curl -O http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/VTK-5.6.1.patchCreatis.tar.gz
145 curl -O http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/gdcm_05_Mai_2011.tar.gz
146 curl -O http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/InsightToolkit-3.20.0.tar.gz
147 curl -O http://www.creatis.insa-lyon.fr/software/public/creatools/crea_Developer_Tools/All_Versions/tth/tth_linux/tth
149 tar -xvf VTK-5.6.1.patchCreatis.tar.gz
150 tar -xvf gdcm_05_Mai_2011.tar.gz
151 tar -xvf InsightToolkit-3.20.0.tar.gz
154 wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/VTK-5.6.1.patchCreatis.tar.gz
155 wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/gdcm_05_Mai_2011.tar.gz
156 wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/InsightToolkit-3.20.0.tar.gz
157 wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_Developer_Tools/All_Versions/tth/tth_linux/tth
159 tar -xvzf VTK-5.6.1.patchCreatis.tar.gz
160 tar -xvzf gdcm_05_Mai_2011.tar.gz
161 tar -xvzf InsightToolkit-3.20.0.tar.gz
167 if [ $buildType = "Debug" ]
175 # the following stupid test is used at debug time; Please don't remove!
180 dirInstall=$binDir/$libname-Bin
181 dirInstallVTK=$dirInstall
182 export VTK_DIR=$installPrefixThird/lib/vtk-5.6/
186 cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
187 ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
188 cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefixThird CMakeCache.txt
189 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
196 # the following stupid test is used at debug time; Please don't remove!
201 dirInstall=$binDir/$libname-Bin
202 export GDCM_DIR=$installPrefixThird/lib/gdcm/
205 cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
206 ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
207 cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefixThird CMakeCache.txt
208 cmake -D VTK_DIR:PATH=$dirInstallVTK CMakeCache.txt
209 cmake -D GDCM_VTK:BOOL=ON -D GDCM_NAME_SPACE:STRING=gdcm13 CMakeCache.txt
215 # the following stupid test is used at debug time; Please don't remove!
219 libname=InsightToolkit-3.20.0
220 dirInstall=$binDir/$libname-Bin
221 export ITK_DIR=$installPrefixThird/lib/InsightToolkit/
224 cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
225 ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
226 cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefixThird CMakeCache.txt
227 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
228 #uncomment following line if you want to use the bleeding edge of GDCM2!
229 #cmake -D ITK_USE_SYSTEM_GDCM:BOOL=ON CMakeCache.txt
240 # cp tth $installPrefixThird/bin
244 #deal with create creatools_third_party_libraries_config.sh
246 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
248 rm $installPrefixThird/share/creatools_third_party_library_config.sh
251 if [ ! -e $installPrefixThird/share ]
253 mkdir $installPrefixThird/share
255 touch $installPrefixThird/share/creatools_third_party_library_config.sh
256 chmod 755 $installPrefixThird/share/creatools_third_party_library_config.sh
258 echo export PATH='$'PATH:$installPrefixThird/bin >> $installPrefixThird/share/creatools_third_party_library_config.sh
259 echo export VTK_DIR=$installPrefixThird/lib/vtk-5.6 >> $installPrefixThird/share/creatools_third_party_library_config.sh
260 echo export ITK_DIR=$installPrefixThird/lib/InsightToolkit >> $installPrefixThird/share/creatools_third_party_library_config.sh
261 echo export GDCM_DIR=$installPrefixThird/lib/gdcm >> $installPrefixThird/share/creatools_third_party_library_config.sh
262 echo export TTH=$installPrefixThird/bin/tth >> $installPrefixThird/share/creatools_third_party_library_config.sh
263 if [ $OperatingSystem = "MacOS" ]
265 echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$GDCM_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh
266 echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$ITK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh
267 echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$VTK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh
269 echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$GDCM_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh
270 echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$ITK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh
271 echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$VTK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh
275 # - remove line 'bash $installPrefixThird/share/creatools_third_party_library_config.sh' if any (with accurate value for ???)
277 # Install creatools as user (no longer as root) // JPR 2/5/2011
278 #if [ ! -f /etc/bashrc ]
280 # export ETC_BASHRC="/etc/bash.bashrc"
282 # export ETC_BASHRC="/etc/bashrc"
285 case "$OperatingSystem" in
287 export ETC_BASHRC=$HOME/.bashrc
290 export ETC_BASHRC=$HOME/.bashrc
293 export ETC_BASHRC=$HOME/.profile
298 sed -i -e '/.*installPrefixThird*/ d' $ETC_BASHRC
299 sed -i -e '/.*creatools_third_party_library_config.*/ d' $ETC_BASHRC
302 # - add line 'bash $installPrefixThird/share/creatools_third_party_library_config.sh' (with accurate value for ???)
303 echo installPrefixThird=$installPrefixThird >> $ETC_BASHRC
304 echo '[ -f "$installPrefixThird/share/creatools_third_party_library_config.sh" ] && source $installPrefixThird/share/creatools_third_party_library_config.sh' >> $ETC_BASHRC