]> Creatis software - cpPlugins.git/commitdiff
Third-party installers updated.
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Mon, 25 Apr 2016 11:07:31 +0000 (06:07 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Mon, 25 Apr 2016 11:07:31 +0000 (06:07 -0500)
appli/bash/cpPlugins_ExecuteWorkspace.cxx [new file with mode: 0644]
third_party_installers/cpPlugins_Install_CMAKE.sh [new file with mode: 0755]
third_party_installers/cpPlugins_Install_ITK.sh
third_party_installers/cpPlugins_Install_QT4.sh
third_party_installers/cpPlugins_Install_VTK.sh

diff --git a/appli/bash/cpPlugins_ExecuteWorkspace.cxx b/appli/bash/cpPlugins_ExecuteWorkspace.cxx
new file mode 100644 (file)
index 0000000..4c847b1
--- /dev/null
@@ -0,0 +1,33 @@
+#include <iostream>
+#include <set>
+#include <string>
+#include <vector>
+#include <cpPlugins_Config.h>
+
+int main( int argc, char* argv[] )
+{
+  if( argc == 1 )
+  {
+    std::cout << "Usage: " << argv[ 0 ] << " workspace args" << std::endl;
+    return( 1 );
+
+  } // fi
+  std::set< std::string > parameters;
+  std::set< std::string > plugins;
+
+  // Read arguments
+  std::string ws_file = argv[ 1 ];
+  for( unsigned int i = 2; i < argc; ++i )
+  {
+    std::vector< std::string > tokens;
+    cpPlugins::TokenizeString( tokens, argv[ i ], "=" );
+    if( tokens.size( ) < 2 )
+      continue;
+    if     ( tokens[ 0 ] == "pl" ) plugins.insert( tokens[ 1 ] );
+    else if( tokens[ 0 ] == "pa" ) parameters.insert( tokens[ 1 ] );
+
+  } // rof
+  return( 0 );
+}
+
+// eof - $RCSfile$
diff --git a/third_party_installers/cpPlugins_Install_CMAKE.sh b/third_party_installers/cpPlugins_Install_CMAKE.sh
new file mode 100755 (executable)
index 0000000..61f0580
--- /dev/null
@@ -0,0 +1,69 @@
+#!/bin/bash
+
+## Some configuration variables
+number_of_processes="-j4"
+
+## Check input parameters and process inputs (if needed)
+if [ "$#" -eq 1 ]; then
+    valid_extensions=("zip" "tar" "tar.gz" "tar.bz2")
+    actual_ext=""
+    for ext in ${valid_extensions[@]}; do
+        if [ `basename $1 $ext` != $1 ]; then
+            actual_ext=$ext
+        fi
+    done
+    if [ "x$actual_ext" == "x" ]; then
+        echo "$0: Invalid file type."
+        exit 1
+    fi
+    canonical_path=`readlink -e $1`
+    source_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`
+    build_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`-build
+    echo -n "Cleaning directories... "
+    rm -rf $source_dir
+    rm -rf $build_dir
+    echo "done."
+    echo -n "Creating directories... "
+    mkdir -p $source_dir
+    mkdir -p $build_dir
+    echo "done."
+    echo -n "Extracting sources... "
+    if [ "$actual_ext" == "zip" ]; then
+        echo unzip $canonical_path
+    elif [ "$actual_ext" == "tar" ]; then
+        tar xf $canonical_path -C $source_dir --strip-components=1
+    elif [ "$actual_ext" == "tar.gz" ]; then
+        tar xzf $canonical_path -C $source_dir --strip-components=1
+    elif [ "$actual_ext" == "tar.bz2" ]; then
+        tar xjf $canonical_path -C $source_dir --strip-components=1
+    else
+        echo "$0: Invalid file type."
+        exit 1
+    fi
+    echo "done!"
+elif [ "$#" -eq 2 ]; then
+    source_dir=`dirname $1`
+    build_dir=`dirname $2`
+else
+    echo "Usage: [cmake_package] or [cmake_source_dir cmake_build_dir]" 
+fi
+
+echo "Given source dir : \"$source_dir\""
+echo "Given build dir  : \"$build_dir\""
+
+echo "Configuring sources... "
+cd $build_dir
+$source_dir/bootstrap --prefix=${HOME}/local
+echo "Configuring sources... done."
+
+echo "Compiling sources..."
+cd $build_dir
+make $number_of_processes
+echo "Compiling sources... done."
+
+echo "Installing package..."
+cd $build_dir
+make -j install
+echo "Installing package... done."
+
+## eof - $RCSfile$
index d9ca4ff09d149c00ccb0db30774f23428dfbc13e..8af7e094aaa2d52e2cf93cf0e0584d3a43ed63a8 100755 (executable)
@@ -2,6 +2,7 @@
 
 ## Some configuration variables
 number_of_processes="-j4"
+comp_type=Debug
 
 ## Locate cmake executable
 cmake_exec="/usr/bin/cmake"
@@ -72,7 +73,7 @@ $cmake_exec \
     -DBUILD_EXAMPLES:BOOL=OFF \
     -DBUILD_SHARED_LIBS:BOOL=ON \
     -DBUILD_TESTING:BOOL=OFF \
-    -DCMAKE_BUILD_TYPE:STRING=MinSizeRel \
+    -DCMAKE_BUILD_TYPE:STRING=$comp_type \
     -DModule_ITKReview:BOOL=ON \
     -DModule_ITKVtkGlue:BOOL=OFF \
     -DCMAKE_INSTALL_PREFIX:PATH=${HOME}/local \
index cb3afc329a1b7b809468296ca785b8b7d10e6836..7f761cffb2cf2002ad077d2d4cbe3ac09f64367d 100755 (executable)
@@ -1,5 +1,10 @@
 #!/bin/bash
 
+## Some configuration variables
+number_of_processes="-j4"
+comp_type=-debug-and-release
+# particular_options=-no-framework
+
 ## Check input parameters and process inputs (if needed)
 if [ "$#" -eq 1 ]; then
     valid_extensions=("zip" "tar" "tar.gz" "tar.bz2")
@@ -52,14 +57,21 @@ echo "Configuring sources... "
 cd $build_dir
 $source_dir/configure \
     -prefix ${HOME}/local \
-    -release -opensource -shared -fast -no-webkit \
-    -optimized-qmake -no-framework \
-    -confirm-license yes
+    $comp_type \
+    -opensource -shared -fast \
+    -no-phonon \
+    -no-phonon-backend \
+    -no-webkit \
+    -no-openvg \
+    -nomake demos -nomake examples \
+    -optimized-qmake \
+    $particular_options \
+    -confirm-license
 echo "Configuring sources... done."
 
 echo "Compiling sources..."
 cd $build_dir
-make
+make $number_of_processes
 echo "Compiling sources... done."
 
 echo "Installing package..."
index 59c3b8afbc5326e4634037f974739307a3d577ff..a1ed2fc7203e39aebdc5c0d221c50c8103078f14 100755 (executable)
@@ -2,6 +2,7 @@
 
 ## Some configuration variables
 number_of_processes="-j4"
+comp_type=Debug
 
 ## Locate cmake executable
 cmake_exec="/usr/bin/cmake"
@@ -17,17 +18,68 @@ if [ ! -x $cmake_exec ]; then
 fi
 
 ## Locate qmake executable
-cmake_exec="/usr/bin/qmake"
-if [ ! -x $cmake_exec ]; then
-    cmake_exec="/usr/local/bin/qmake"
-fi
-if [ ! -x $cmake_exec ]; then
-    cmake_exec="${HOME}/local/bin/qmake"
-fi
-if [ ! -x $cmake_exec ]; then
-    echo "$0: modify this script to put the correct location of qmake."
-    exit 1
-fi
+qmake_dirs=("/usr/bin" "/usr/local/bin" "${HOME}/local/bin")
+qmake_exec=""
+for dir in ${qmake_dirs[@]}; do
+    echo $dir
+done
+
+
+# qmake_exec="/usr/bin/qmake"
+# number="0"
+# if [ -x $qmake_exec ]; then
+#     version=`$qmake_exec --version | grep Using\ Qt\ version`
+#     number=`expr substr "$version" 18 1`
+# else
+#     qmake_exec=""
+# fi
+# if [ "$number" -ne "4" ]; then
+#     qmake_exec=""
+# fi
+# echo 1$qmake_exec
+
+# if [ "x$qmake_exec" != "x" ]; then
+#     qmake_exec="/usr/local/bin/qmake"
+#     if [ ! -x $qmake_exec ]; then
+#         number="0"
+#         if [ -x $qmake_exec ]; then
+#             version=`$qmake_exec --version | grep Using\ Qt\ version`
+#             number=`expr substr "$version" 18 1`
+#         fi
+#         if [ "$number" -ne "4" ]; then
+#             qmake_exec=""
+#         fi
+#     else
+#         qmake_exec=""
+#     fi
+# else
+#     qmake_exec=""
+# fi
+# if [ "x$qmake_exec" != "x" ]; then
+#     qmake_exec="${HOME}/local/bin/qmake"
+#     if [ ! -x $qmake_exec ]; then
+#         number="0"
+#         if [ -x $qmake_exec ]; then
+#             version=`$qmake_exec --version | grep Using\ Qt\ version`
+#             number=`expr substr "$version" 18 1`
+#         fi
+#         echo $number
+#         if [ "$number" -ne "4" ]; then
+#             qmake_exec=""
+#         fi
+#     else
+#         qmake_exec=""
+#     fi
+# else
+#     qmake_exec=""
+# fi
+# if [ ! -x $qmake_exec ]; then
+#     echo "$0: modify this script to put the correct location of qmake."
+#     exit 1
+# fi
+# echo $qmake_exec
+
+exit 1
 
 ## Check input parameters and process inputs (if needed)
 if [ "$#" -eq 1 ]; then
@@ -85,7 +137,8 @@ $cmake_exec \
     -DBUILD_EXAMPLES:BOOL=OFF \
     -DBUILD_SHARED_LIBS:BOOL=ON \
     -DBUILD_TESTING:BOOL=OFF \
-    -DCMAKE_BUILD_TYPE:STRING=MinSizeRel \
+    -DQT_QMAKE_EXECUTABLE:PATH=$qmake_exec \
+    -DCMAKE_BUILD_TYPE:STRING=$comp_type \
     -DModule_vtkGUISupportQt:BOOL=ON \
     -DModule_vtkGUISupportQtOpenGL:BOOL=ON \
     -DModule_vtkGUISupportQtSQL:BOOL=OFF \