2 if [ ! -f $PWD/scripts/CreaTools-configure.sh ]
6 echo "==================================================="
9 echo "YOU NEED TO RUN 'Configure' (0) First !"
10 echo "==================================================="
16 source $PWD/scripts/CreaTools-configure.sh
19 echo $PWD/scripts/CreaTools-configure.sh
20 echo --generationdir--
24 echo --docgeneration--
26 echo --installPrefix--
28 echo --installPrefixThird--
29 echo $installPrefixThird
34 # echo --sourcesFrom--
38 # echo --start_point--
44 sourcesDir=$generationdir/thirdparty_sources
45 binDir=$generationdir/thirdparty_bin
47 if [ ! -e $generationdir ]
50 chown $loginUserName:$loginGroupName $generationdir
52 if [ ! -e $sourcesDir ]
55 chown $loginUserName:$loginGroupName $sourcesDir
61 chown $loginUserName:$loginGroupName $binDir
65 # the following stupid test is used at debug time; Please don't remove!
70 case "$OperatingSystem" in
73 yum install cmake-gui -y
74 yum install doxygen -y
75 yum install graphviz -y
76 yum install texlive -y
77 yum install latex2html -y
78 yum install wxGTK-devel wxBase -y
79 yum install boost-devel -y
80 yum install sqlite-devel -y
81 yum install qt-devel -y
82 yum install mesa-libOSMesa-devel -y
85 apt-get --yes install build-essential # esta linea instala las librerias necesarias para compilar en ubuntu, g++ gcc etc etc etc.
86 apt-get --yes install cmake
87 apt-get --yes install cmake-gui
88 apt-get --yes install cmake-curses-gui
89 apt-get --yes install doxygen
90 apt-get --yes install graphviz
91 apt-get --yes install texlive
92 apt-get --yes install latex2html
93 apt-get --yes install libgtk2.0-dev #GTK
94 apt-get --yes install libwxgtk2.8-dev #Wx GTK
95 apt-get --yes install libwxbase2.8-dev #Wx solito
96 apt-get --yes install libboost-dev #Boost
97 apt-get --yes install libboost-all-dev #Boost
98 apt-get --yes install libqt4-dev #QT4
99 apt-get --yes install sqlite
100 apt-get --yes install libsqlite0-dev
101 apt-get --yes install libosmesa6-dev #Mesa6
102 apt-get --yes install uuid-dev # uuid para la instalacion de itk
103 apt-get --yes install libxaw7-dev # X11
106 # QUESTION : is -y mandatory?
108 port install cmake -y
109 port install cmake-gui -y
110 port install doxygen -y
111 port install graphviz -y
112 port install texlive -y
113 port install latex2html -y
114 port install wxGTK-devel wxBase -y
115 port install boost-devel -y
116 port install sqlite-devel -y
117 port install qt-devel -y
118 port install mesa-libOSMesa-devel -y
121 #echo " '$OperatingSystem' : Unknown (for us...) Operating Sytem "
122 echo " Allowed values are (right now) Fedora, Ubuntu, MacOS "
130 # the following stupid test is used at debug time; Please don't remove!
134 rm -rf $sourcesDir/VTK*
135 rm -rf $sourcesDir/vtk*
136 rm -rf $sourcesDir/InsightToolkit*
137 rm -rf $sourcesDir/gdcm*
138 rm -rf $sourcesDir/tth*
141 rm -rf $binDir/InsightToolkit*
145 if [ $OperatingSystem = "MacOS" ]
147 curl http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/VTK-5.6.1.patchCreatis.tar.gz
148 curl http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/gdcm_05_Mai_2011.tar.gz
149 curl http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/InsightToolkit-3.20.0.tar.gz
150 curl http://www.creatis.insa-lyon.fr/software/public/creatools/crea_Developer_Tools/All_Versions/tth/tth_linux/tth
152 wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/VTK-5.6.1.patchCreatis.tar.gz
153 wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/gdcm_05_Mai_2011.tar.gz
154 wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/InsightToolkit-3.20.0.tar.gz
155 wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_Developer_Tools/All_Versions/tth/tth_linux/tth
158 tar -xvzf VTK-5.6.1.patchCreatis.tar.gz
159 tar -xvzf gdcm_05_Mai_2011.tar.gz
160 tar -xvzf InsightToolkit-3.20.0.tar.gz
164 if [ $buildType = "Debug" ]
172 # the following stupid test is used at debug time; Please don't remove!
177 dirInstall=$binDir/$libname-Bin
178 dirInstallVTK=$dirInstall
179 export VTK_DIR=$installPrefixThird/lib/vtk-5.6/
183 cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
184 ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
185 cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefixThird CMakeCache.txt
186 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
193 # the following stupid test is used at debug time; Please don't remove!
198 dirInstall=$binDir/$libname-Bin
199 export GDCM_DIR=$installPrefixThird/lib/gdcm/
202 cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
203 ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
204 cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefixThird CMakeCache.txt
205 cmake -D VTK_DIR:PATH=$dirInstallVTK CMakeCache.txt
206 cmake -D GDCM_VTK:BOOL=ON -D GDCM_NAME_SPACE:STRING=gdcm13 CMakeCache.txt
212 # the following stupid test is used at debug time; Please don't remove!
216 libname=InsightToolkit-3.20.0
217 dirInstall=$binDir/$libname-Bin
218 export ITK_DIR=$installPrefixThird/lib/InsightToolkit/
221 cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
222 ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
223 cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefixThird CMakeCache.txt
224 cmake -D BUILD_EXAMPLES:BOOL=OFF -D BUILD_TESTING:BOOL=OFF -D BUILD_SHARED_LIBS:BOOL=ON -D ITK_USE_REVIEW:BOOL=ON -D ITK_USE_REVIEW_STATISTICS:BOOL=ON CMakeCache.txt
225 #uncomment following line if you want to use the bleeding edge of GDCM2!
226 #cmake -D ITK_USE_SYSTEM_GDCM:BOOL=ON CMakeCache.txt
237 cp tth $installPrefixThird/bin
241 #deal with create creatools_third_party_libraries_config.sh
243 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
245 rm $installPrefixThird/share/creatools_third_party_library_config.sh
248 if [ ! -e $installPrefixThird/share ]
250 mkdir $installPrefixThird/share
252 touch $installPrefixThird/share/creatools_third_party_library_config.sh
253 chmod 755 $installPrefixThird/share/creatools_third_party_library_config.sh
255 echo export PATH='$'PATH:$installPrefixThird/bin >> $installPrefixThird/share/creatools_third_party_library_config.sh
256 echo export VTK_DIR=$installPrefixThird/lib/vtk-5.6 >> $installPrefixThird/share/creatools_third_party_library_config.sh
257 echo export ITK_DIR=$installPrefixThird/lib/InsightToolkit >> $installPrefixThird/share/creatools_third_party_library_config.sh
258 echo export GDCM_DIR=$installPrefixThird/lib/gdcm >> $installPrefixThird/share/creatools_third_party_library_config.sh
259 echo export TTH=$installPrefixThird/bin/tth >> $installPrefixThird/share/creatools_third_party_library_config.sh
260 if [ $OperatingSystem = "MacOS" ]
262 echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$GDCM_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh
263 echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$ITK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh
264 echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$VTK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh
266 echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$GDCM_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh
267 echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$ITK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh
268 echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$VTK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh
272 # - remove line 'bash $installPrefixThird/share/creatools_third_party_library_config.sh' if any (with accurate value for ???)
274 # Install creatools as user (no longer as root) // JPR 2/5/2011
275 #if [ ! -f /etc/bashrc ]
277 # export ETC_BASHRC="/etc/bash.bashrc"
279 # export ETC_BASHRC="/etc/bashrc"
282 case "$OperatingSystem" in
284 export ETC_BASHRC=$HOME/.bashrc
287 export ETC_BASHRC=$HOME/.bashrc
290 export ETC_BASHRC=$HOME/.profile
295 sed -i -e '/.*installPrefixThird*/ d' $ETC_BASHRC
296 sed -i -e '/.*creatools_third_party_library_config.*/ d' $ETC_BASHRC
299 # - add line 'bash $installPrefixThird/share/creatools_third_party_library_config.sh' (with accurate value for ???)
300 echo installPrefixThird=$installPrefixThird >> $ETC_BASHRC
301 echo '[ -f "$installPrefixThird/share/creatools_third_party_library_config.sh" ] && source $installPrefixThird/share/creatools_third_party_library_config.sh' >> $ETC_BASHRC
305 chown -R $loginUserName:$loginGroupName $generationdir