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"
17 ## -- Command line options
18 while [[ "$#" -gt 1 ]]; do
40 ## -- Check command line options
42 [ -z "$prefix" ] ; then
43 (>&2 echo "Usage: $0 -prefix [dir] [-build_dir [dir]] [-cores [n]]")
47 ## -- Complete optional parameters
48 if [ -z "$cores" ] ; then
51 if [ -z "$build_dir" ] ; then
52 build_dir="$HOME/.tmp"
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
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
74 # ## -- Configure, build and install Qt5
75 # mkdir -p $build_dir/qt
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
92 # make -s -j -k install
94 # ## -- Configure, build and install CMake
95 # mkdir -p $build_dir/cmake
97 # $cmake/bootstrap --parallel=$cores --prefix=$prefix --no-qt-gui
99 # make -s -j -k install
101 # ## -- Configure, build and install VTK
103 # patch -s -p1 < $curr_dir/vtk.patch
104 # mkdir -p $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 \
121 # make -s -j$cores -k
122 # use_vtk=`make -j -k -s install | grep UseVTK | sed 's/.*: //'`
124 # ## -- Configure, build and install VTK
125 # mkdir -p $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 \
140 # make -s -j$cores -k
141 # make -s -j -k install