]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Wed, 8 Nov 2017 02:36:30 +0000 (21:36 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Wed, 8 Nov 2017 02:36:30 +0000 (21:36 -0500)
config/install.sh [moved from config/install_cpPlugins.sh with 57% similarity]
config/install_ivq.sh

similarity index 57%
rename from config/install_cpPlugins.sh
rename to config/install.sh
index 4d40462891a10686e5cb138bd098acfce488ee42..9ce8429ce3d354cb602828f3e068441d6d060039 100755 (executable)
@@ -4,30 +4,10 @@
 while [[ "$#" -gt 1 ]]; do
     key="$1"
     case $key in
-        -qt5config)
-        qt5config="$2"
-        shift
-        ;;
-        -cmake)
-        cmake="$2"
-        shift
-        ;;
-        -use_vtk)
-        use_vtk="$2"
-        shift
-        ;;
-        -use_itk)
-        use_itk="$2"
-        shift
-        ;;
         -prefix)
         prefix="$2"
         shift
         ;;
-        -build_dir)
-        build_dir="$2"
-        shift
-        ;;
         -cores)
         cores="$2"
         shift
@@ -45,24 +25,26 @@ done
 
 ## -- Check command line options
 if \
-    [ -z "$qt5config" ] || \
-    [ -z "$cmake" ] || \
-    [ -z "$use_vtk" ] || \
-    [ -z "$use_itk" ] || \
     [ -z "$prefix" ] || \
     [ -z "$cores" ] || \
-    [ -z "$build_type" ] || \
-    [ -z "$build_dir" ] ; then
-    (>&2 echo "Usage: $0 -qt5config [file] -cmake [file] -use_vtk [file] -use_itk [file] -prefix [dir] -build_dir [dir] -build_type [Release/Debug] -cores [n]")
+    [ -z "$build_type" ] ; then
+    (>&2 echo "Usage: $0 -prefix [dir] -build_type [Release/Debug] -cores [n]")
     exit 1
 fi
 
+ccmake=`find $prefix -type f -name "ccmake"`
+qt5config=`find $prefix -type f -name "Qt5Config.cmake"`
+use_vtk=`find $prefix -type f -name "UseVTK.cmake"`
+use_itk=`find $prefix -type f -name "UseITK.cmake"`
+cmake=`dirname $ccmake`/cmake
+
 ## -- Current dir
 curr_dir=`pwd`
+cd ..
 
 ## -- Configure, build and install Qt5
-mkdir -p $build_dir/cpPlugins
-cd $build_dir/cpPlugins
+mkdir -p build
+cd build
 $cmake \
     -DCMAKE_BUILD_TYPE:STRING=$build_type \
     -DCMAKE_INSTALL_PREFIX:PATH=$prefix \
@@ -73,7 +55,7 @@ $cmake \
     -DITK_DIR:PATH=`dirname $use_itk` \
     -DVTK_DIR:PATH=`dirname $use_vtk` \
     -DQt5_DIR:PATH=`dirname $qt5config` \
-    $curr_dir/..
+    ..
 make -s -j$cores -k
 make -s -j -k install
 
index 3139f313ad59dea2e71482c2f632833c41cd2d07..e14b9a7268925669d9fc58596e071f9baca494f8 100755 (executable)
@@ -5,10 +5,18 @@ cmake_version="3.9.5"
 vtk_version="8.0.1"
 itk_version="4.12.2"
 
-cmake_short_version=`echo $cmake_version | sed 's/\.[^.]*$//'`
-cmake_url="https://www.cmake.org/files/v$cmake_short_version/cmake-$cmake_version.tar.gz"
+platform=`uname`
+qt5extras_id="x11"
+if [[ "$platform" == 'Darwin' ]]; then
+    qt5extras_id="mac"
+fi
+
 qt5_short_version=`echo $qt5_version | sed 's/\.[^.]*$//'`
 qt5_url="https://download.qt.io/official_releases/qt/$qt5_short_version/$qt5_version/submodules/qtbase-opensource-src-$qt5_version.tar.xz"
+qt5extras_url="https://download.qt.io/official_releases/qt/$qt5_short_version/$qt5_version/submodules/qt${qt5extras_id}extras-opensource-src-$qt5_version.tar.xz"
+qt5tools_url="https://download.qt.io/official_releases/qt/$qt5_short_version/$qt5_version/submodules/qttools-opensource-src-$qt5_version.tar.xz"
+cmake_short_version=`echo $cmake_version | sed 's/\.[^.]*$//'`
+cmake_url="https://www.cmake.org/files/v$cmake_short_version/cmake-$cmake_version.tar.gz"
 vtk_short_version=`echo $vtk_version | sed 's/\.[^.]*$//'`
 vtk_url="https://www.vtk.org/files/release/$vtk_short_version/VTK-$vtk_version.tar.gz"
 itk_short_version=`echo $itk_version | sed 's/\.[^.]*$//'`
@@ -54,93 +62,108 @@ fi
 curr_dir=`pwd`
 
 ## -- Create build directory
-mkdir -p $build_dir/qt5
-mkdir -p $build_dir/cmake
-mkdir -p $build_dir/vtk
-mkdir -p $build_dir/itk
-platform=`uname`
+mkdir -p $build_dir/qt5/src
+mkdir -p $build_dir/qt5extras/src
+mkdir -p $build_dir/qt5tools/src
+mkdir -p $build_dir/cmake/src
+mkdir -p $build_dir/vtk/src
+mkdir -p $build_dir/itk/src
+mkdir -p $build_dir/qt5/bin
+mkdir -p $build_dir/qt5extras/bin
+mkdir -p $build_dir/qt5tools/bin
+mkdir -p $build_dir/cmake/bin
+mkdir -p $build_dir/vtk/bin
+mkdir -p $build_dir/itk/bin
 if [[ "$platform" == 'Linux' ]]; then
     wget -O $build_dir/qt5/qt5.tar.xz $qt5_url
-    wget -O $build_dir/cmake/cmake.tar.xz $cmake_url
-    wget -O $build_dir/vtk/vtk.tar.xz $vtk_url
+    wget -O $build_dir/qt5extras/qt5extras.tar.xz $qt5extras_url
+    wget -O $build_dir/qt5tools/qt5tools.tar.xz $qt5tools_url
+    wget -O $build_dir/cmake/cmake.tar.gz $cmake_url
+    wget -O $build_dir/vtk/vtk.tar.gz $vtk_url
     wget -O $build_dir/itk/itk.tar.xz $itk_url
 elif [[ "$platform" == 'Darwin' ]]; then
     curl -o $build_dir/qt5/qt5.tar.xz $qt5_url
-    curl -o $build_dir/cmake/cmake.tar.xz $cmake_url
-    curl -o $build_dir/vtk/vtk.tar.xz $vtk_url
+    curl -o $build_dir/qt5extras/qt5extras.tar.xz $qt5extras_url
+    curl -o $build_dir/qt5tools/qt5tools.tar.xz $qt5tools_url
+    curl -o $build_dir/cmake/cmake.tar.gz $cmake_url
+    curl -o $build_dir/vtk/vtk.tar.gz $vtk_url
     curl -o $build_dir/itk/itk.tar.xz $itk_url
 fi
+tar xvf $build_dir/qt5/qt5.tar.xz -C $build_dir/qt5/src --strip-components=1
+tar xvf $build_dir/qt5extras/qt5extras.tar.xz -C $build_dir/qt5extras/src --strip-components=1
+tar xvf $build_dir/qt5tools/qt5tools.tar.xz -C $build_dir/qt5tools/src --strip-components=1
+tar xvf $build_dir/cmake/cmake.tar.gz -C $build_dir/cmake/src --strip-components=1
+tar xvf $build_dir/vtk/vtk.tar.gz -C $build_dir/vtk/src --strip-components=1
+tar xvf $build_dir/itk/itk.tar.xz -C $build_dir/itk/src --strip-components=1
+
+## -- Configure, build and install Qt5
+cd $build_dir/qt5/bin
+$build_dir/qt5/src/configure \
+    -prefix $prefix -shared -confirm-license -opensource -release \
+    -c++std c++11 -opengl desktop \
+    -nomake examples -nomake tests -no-harfbuzz \
+    -qt-xcb -qt-xkbcommon -qt-pcre
+make -s -j$cores -k
+make -s -j -k install
+
+## -- Configure, build and install Qt5Extras
+cd $build_dir/qt5extras/bin
+$prefix/bin/qmake $build_dir/qt5extras/src
+make -s -j$cores -k
+make -s -j -k install
 
-# ## -- Configure, build and install Qt5
-# mkdir -p $build_dir/qt
-# cd $build_dir/qt
-# $qt/configure \
-#     -prefix $prefix -shared -confirm-license -opensource -release \
-#     -c++std c++11 -opengl desktop \
-#     -nomake examples -nomake tests -no-harfbuzz \
-#     -qt-xcb -qt-xkbcommon -qt-pcre \
-#     -skip qt3d  -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity \
-#     -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad \
-#     -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation \
-#     -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing \
-#     -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscript \
-#     -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport \
-#     -skip qtspeech -skip qtsvg -skip qttranslations -skip qtvirtualkeyboard \
-#     -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets \
-#     -skip qtwebview -skip qtxmlpatterns
-# make -s -j$cores -k
-# make -s -j -k install
+## -- Configure, build and install Qt5Tools
+cd $build_dir/qt5tools/bin
+$prefix/bin/qmake $build_dir/qt5tools/src
+make -s -j$cores -k
+make -s -j -k install
 
-# ## -- Configure, build and install CMake
-# mkdir -p $build_dir/cmake
-# cd $build_dir/cmake
-# $cmake/bootstrap --parallel=$cores --prefix=$prefix --no-qt-gui
-make -s -j$cores -k
-make -s -j -k install
+## -- Configure, build and install CMake
+cd $build_dir/cmake/bin
+$build_dir/cmake/src/bootstrap \
+    --parallel=$cores --prefix=$prefix --no-qt-gui
+make -s -j$cores -k
+make -s -j -k install
 
-# ## -- Configure, build and install VTK
-# cd $vtk
-# patch -s -p1 < $curr_dir/vtk.patch
-# mkdir -p $build_dir/vtk
-# cd $build_dir/vtk
-# $prefix/bin/cmake \
-#     -DCMAKE_CXX_FLAGS:STRING=-std=c++11 \
-#     -DBUILD_SHARED_LIBS:BOOL=ON \
-#     -DCMAKE_BUILD_TYPE:STRING=Release \
-#     -DCMAKE_INSTALL_PREFIX:PATH=$prefix \
-#     -DBUILD_DOCUMENTATION:BOOL=OFF \
-#     -DBUILD_EXAMPLES:BOOL=OFF \
-#     -DBUILD_TESTING:BOOL=OFF \
-#     -DVTK_Group_Qt:BOOL=ON \
-#     -DVTK_QT_VERSION:STRING=5 \
-#     -DQt5_DIR:PATH=$prefix/lib/cmake/Qt5 \
-#     -DQT_QMAKE_EXECUTABLE:PATH=$prefix/bin/qmake \
-#     -DModule_vtkGUISupportQtOpenGL:BOOL=ON \
-#     -DCMAKE_MACOSX_RPATH:BOOL=ON \
-#     $vtk
-# make -s -j$cores -k
-# use_vtk=`make -j -k -s install | grep UseVTK | sed 's/.*: //'`
+## -- Configure, build and install VTK
+cd $build_dir/vtk/bin
+$prefix/bin/cmake \
+    -DCMAKE_CXX_FLAGS:STRING=-std=c++11 \
+    -DVTK_USE_CXX11_FEATURES:BOOL=ON \
+    -DBUILD_SHARED_LIBS:BOOL=ON \
+    -DCMAKE_BUILD_TYPE:STRING=Release \
+    -DCMAKE_INSTALL_PREFIX:PATH=$prefix \
+    -DBUILD_DOCUMENTATION:BOOL=OFF \
+    -DBUILD_EXAMPLES:BOOL=OFF \
+    -DBUILD_TESTING:BOOL=OFF \
+    -DVTK_Group_Qt:BOOL=ON \
+    -DVTK_QT_VERSION:STRING=5 \
+    -DQt5_DIR:PATH=$prefix/lib/cmake/Qt5 \
+    -DVTK_Group_Qt:BOOL=ON \
+    -DCMAKE_MACOSX_RPATH:BOOL=ON \
+    $build_dir/vtk/src
+make -s -j$cores -k
+use_vtk=`make -j -k -s install | grep UseVTK | sed 's/.*: //'`
 
-# ## -- Configure, build and install VTK
-# mkdir -p $build_dir/itk
-# cd $build_dir/itk
-# $prefix/bin/cmake \
-#     -DCMAKE_CXX_FLAGS:STRING=-std=c++11 \
-#     -DBUILD_SHARED_LIBS:BOOL=ON \
-#     -DCMAKE_BUILD_TYPE:STRING=Release \
-#     -DCMAKE_INSTALL_PREFIX:PATH=$prefix \
-#     -DBUILD_DOCUMENTATION:BOOL=OFF \
-#     -DBUILD_EXAMPLES:BOOL=OFF \
-#     -DBUILD_TESTING:BOOL=OFF \
-#     -DVTK_DIR:PATH=`dirname $use_vtk` \
-#     -DModule_ITKReview:BOOL=ON \
-#     -DModule_ITKVtkGlue:BOOL=ON \
-#     -DCMAKE_MACOSX_RPATH:BOOL=ON \
-#     $itk
-# make -s -j$cores -k
-# make -s -j -k install
+## -- Configure, build and install VTK
+cd $build_dir/itk/bin
+$prefix/bin/cmake \
+    -DCMAKE_CXX_FLAGS:STRING=-std=c++11 \
+    -DBUILD_SHARED_LIBS:BOOL=ON \
+    -DCMAKE_BUILD_TYPE:STRING=Release \
+    -DCMAKE_INSTALL_PREFIX:PATH=$prefix \
+    -DBUILD_DOCUMENTATION:BOOL=OFF \
+    -DBUILD_EXAMPLES:BOOL=OFF \
+    -DBUILD_TESTING:BOOL=OFF \
+    -DVTK_DIR:PATH=`dirname $use_vtk` \
+    -DModule_ITKReview:BOOL=ON \
+    -DModule_ITKVtkGlue:BOOL=ON \
+    -DCMAKE_MACOSX_RPATH:BOOL=ON \
+    $build_dir/itk/src
+make -s -j$cores -k
+make -s -j -k install
 
-# ## -- End
-cd $curr_dir
+## -- End
+cd $curr_dir
 
 ## eof - $RCSfile$