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