3 ## -- Command line options
4 while [[ "$#" -gt 1 ]]; do
46 ## -- Check command line options
53 (>&2 echo "Usage: $0 -prefix [dir] -qt [dir] -cmake [dir] -vtk [dir] -itk [dir] [-build_dir [dir]] [-suffix [string]] [-cores [n]]")
57 ## -- Complete optional parameters
58 if [ -z "$cores" ] ; then
61 if [ -z "$build_dir" ] ; then
62 build_dir="$HOME/.tmp"
64 if [ ! -z "$suffix" ] ; then
65 qt_suffix="-qtlibinfix $suffix"
69 ## -- Configure, build and install Qt5
70 mkdir -p $build_dir/qt
73 -prefix $prefix -shared -confirm-license -opensource -release \
74 -c++std c++11 -opengl desktop \
75 -nomake examples -nomake tests -no-harfbuzz \
76 -qt-xcb -qt-xkbcommon -qt-pcre \
77 -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity \
78 -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad \
79 -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation \
80 -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing \
81 -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscript \
82 -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport \
83 -skip qtspeech -skip qtsvg -skip qttranslations -skip qtvirtualkeyboard \
84 -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets \
85 -skip qtwebview -skip qtxmlpatterns $qt_suffix
89 ## -- Configure, build and install CMake
90 mkdir -p $build_dir/cmake
92 $cmake/bootstrap --parallel=$cores --prefix=$prefix --no-qt-gui
96 ## -- Configure, build and install VTK
98 patch -s -p1 < $curr_dir/vtk.patch
99 mkdir -p $build_dir/vtk
102 -DCMAKE_CXX_FLAGS:STRING=-std=c++11 \
103 -DBUILD_SHARED_LIBS:BOOL=ON \
104 -DCMAKE_BUILD_TYPE:STRING=Release \
105 -DCMAKE_INSTALL_PREFIX:PATH=$prefix \
106 -DBUILD_DOCUMENTATION:BOOL=OFF \
107 -DBUILD_EXAMPLES:BOOL=OFF \
108 -DBUILD_TESTING:BOOL=OFF \
109 -DVTK_Group_Qt:BOOL=ON \
110 -DVTK_QT_VERSION:STRING=5 \
111 -DQt5_DIR:PATH=$prefix/lib/cmake/Qt5 \
112 -DQT_QMAKE_EXECUTABLE:PATH=$prefix/bin/qmake \
113 -DModule_vtkGUISupportQtOpenGL:BOOL=ON \
114 -DCMAKE_DEBUG_POSTFIX:STRING=$suffix \
115 -DCMAKE_RELEASE_POSTFIX:STRING=$suffix \
116 -DCMAKE_MACOSX_RPATH:BOOL=ON \
119 use_vtk=`make -j -k -s install | grep UseVTK | sed 's/.*: //'`
121 ## -- Configure, build and install VTK
122 mkdir -p $build_dir/itk
125 -DCMAKE_CXX_FLAGS:STRING=-std=c++11 \
126 -DBUILD_SHARED_LIBS:BOOL=ON \
127 -DCMAKE_BUILD_TYPE:STRING=Release \
128 -DCMAKE_INSTALL_PREFIX:PATH=$prefix \
129 -DBUILD_DOCUMENTATION:BOOL=OFF \
130 -DBUILD_EXAMPLES:BOOL=OFF \
131 -DBUILD_TESTING:BOOL=OFF \
132 -DVTK_DIR:PATH=`dirname $use_vtk` \
133 -DModule_ITKReview:BOOL=ON \
134 -DModule_ITKVtkGlue:BOOL=ON \
135 -DCMAKE_DEBUG_POSTFIX:STRING=$suffix \
136 -DCMAKE_RELEASE_POSTFIX:STRING=$suffix \
137 -DCMAKE_MACOSX_RPATH:BOOL=ON \
140 make -s -j -k install