]> Creatis software - cpPlugins.git/blob - config/install_ivq.sh
3139f313ad59dea2e71482c2f632833c41cd2d07
[cpPlugins.git] / config / install_ivq.sh
1 #!/bin/bash
2
3 qt5_version="5.9.2"
4 cmake_version="3.9.5"
5 vtk_version="8.0.1"
6 itk_version="4.12.2"
7
8 cmake_short_version=`echo $cmake_version | sed 's/\.[^.]*$//'`
9 cmake_url="https://www.cmake.org/files/v$cmake_short_version/cmake-$cmake_version.tar.gz"
10 qt5_short_version=`echo $qt5_version | sed 's/\.[^.]*$//'`
11 qt5_url="https://download.qt.io/official_releases/qt/$qt5_short_version/$qt5_version/submodules/qtbase-opensource-src-$qt5_version.tar.xz"
12 vtk_short_version=`echo $vtk_version | sed 's/\.[^.]*$//'`
13 vtk_url="https://www.vtk.org/files/release/$vtk_short_version/VTK-$vtk_version.tar.gz"
14 itk_short_version=`echo $itk_version | sed 's/\.[^.]*$//'`
15 itk_url="https://downloads.sourceforge.net/project/itk/itk/$itk_short_version/InsightToolkit-$itk_version.tar.xz"
16
17 ## -- Command line options
18 while [[ "$#" -gt 1 ]]; do
19     key="$1"
20     case $key in
21         -prefix)
22         prefix="$2"
23         shift
24         ;;
25         -build_dir)
26         build_dir="$2"
27         shift
28         ;;
29         -cores)
30         cores="$2"
31         shift
32         ;;
33         *)
34         # Do nothing
35         ;;
36     esac
37     shift
38 done
39
40 ## -- Check command line options
41 if \
42     [ -z "$prefix" ] ; then
43     (>&2 echo "Usage: $0 -prefix [dir] [-build_dir [dir]] [-cores [n]]")
44     exit 1
45 fi
46
47 ## -- Complete optional parameters
48 if [ -z "$cores" ] ; then
49     cores="1"
50 fi
51 if [ -z "$build_dir" ] ; then
52     build_dir="$HOME/.tmp"
53 fi
54 curr_dir=`pwd`
55
56 ## -- Create build directory
57 mkdir -p $build_dir/qt5
58 mkdir -p $build_dir/cmake
59 mkdir -p $build_dir/vtk
60 mkdir -p $build_dir/itk
61 platform=`uname`
62 if [[ "$platform" == 'Linux' ]]; then
63     wget -O $build_dir/qt5/qt5.tar.xz $qt5_url
64     wget -O $build_dir/cmake/cmake.tar.xz $cmake_url
65     wget -O $build_dir/vtk/vtk.tar.xz $vtk_url
66     wget -O $build_dir/itk/itk.tar.xz $itk_url
67 elif [[ "$platform" == 'Darwin' ]]; then
68     curl -o $build_dir/qt5/qt5.tar.xz $qt5_url
69     curl -o $build_dir/cmake/cmake.tar.xz $cmake_url
70     curl -o $build_dir/vtk/vtk.tar.xz $vtk_url
71     curl -o $build_dir/itk/itk.tar.xz $itk_url
72 fi
73
74 # ## -- Configure, build and install Qt5
75 # mkdir -p $build_dir/qt
76 # cd $build_dir/qt
77 # $qt/configure \
78 #     -prefix $prefix -shared -confirm-license -opensource -release \
79 #     -c++std c++11 -opengl desktop \
80 #     -nomake examples -nomake tests -no-harfbuzz \
81 #     -qt-xcb -qt-xkbcommon -qt-pcre \
82 #     -skip qt3d  -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity \
83 #     -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad \
84 #     -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation \
85 #     -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing \
86 #     -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscript \
87 #     -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport \
88 #     -skip qtspeech -skip qtsvg -skip qttranslations -skip qtvirtualkeyboard \
89 #     -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets \
90 #     -skip qtwebview -skip qtxmlpatterns
91 # make -s -j$cores -k
92 # make -s -j -k install
93
94 # ## -- Configure, build and install CMake
95 # mkdir -p $build_dir/cmake
96 # cd $build_dir/cmake
97 # $cmake/bootstrap --parallel=$cores --prefix=$prefix --no-qt-gui
98 # make -s -j$cores -k
99 # make -s -j -k install
100
101 # ## -- Configure, build and install VTK
102 # cd $vtk
103 # patch -s -p1 < $curr_dir/vtk.patch
104 # mkdir -p $build_dir/vtk
105 # cd $build_dir/vtk
106 # $prefix/bin/cmake \
107 #     -DCMAKE_CXX_FLAGS:STRING=-std=c++11 \
108 #     -DBUILD_SHARED_LIBS:BOOL=ON \
109 #     -DCMAKE_BUILD_TYPE:STRING=Release \
110 #     -DCMAKE_INSTALL_PREFIX:PATH=$prefix \
111 #     -DBUILD_DOCUMENTATION:BOOL=OFF \
112 #     -DBUILD_EXAMPLES:BOOL=OFF \
113 #     -DBUILD_TESTING:BOOL=OFF \
114 #     -DVTK_Group_Qt:BOOL=ON \
115 #     -DVTK_QT_VERSION:STRING=5 \
116 #     -DQt5_DIR:PATH=$prefix/lib/cmake/Qt5 \
117 #     -DQT_QMAKE_EXECUTABLE:PATH=$prefix/bin/qmake \
118 #     -DModule_vtkGUISupportQtOpenGL:BOOL=ON \
119 #     -DCMAKE_MACOSX_RPATH:BOOL=ON \
120 #     $vtk
121 # make -s -j$cores -k
122 # use_vtk=`make -j -k -s install | grep UseVTK | sed 's/.*: //'`
123
124 # ## -- Configure, build and install VTK
125 # mkdir -p $build_dir/itk
126 # cd $build_dir/itk
127 # $prefix/bin/cmake \
128 #     -DCMAKE_CXX_FLAGS:STRING=-std=c++11 \
129 #     -DBUILD_SHARED_LIBS:BOOL=ON \
130 #     -DCMAKE_BUILD_TYPE:STRING=Release \
131 #     -DCMAKE_INSTALL_PREFIX:PATH=$prefix \
132 #     -DBUILD_DOCUMENTATION:BOOL=OFF \
133 #     -DBUILD_EXAMPLES:BOOL=OFF \
134 #     -DBUILD_TESTING:BOOL=OFF \
135 #     -DVTK_DIR:PATH=`dirname $use_vtk` \
136 #     -DModule_ITKReview:BOOL=ON \
137 #     -DModule_ITKVtkGlue:BOOL=ON \
138 #     -DCMAKE_MACOSX_RPATH:BOOL=ON \
139 #     $itk
140 # make -s -j$cores -k
141 # make -s -j -k install
142
143 # ## -- End
144 # cd $curr_dir
145
146 ## eof - $RCSfile$