From 3ebae8769e6474d6410214c95c329d0189f1d074 Mon Sep 17 00:00:00 2001 From: Leonardo Florez-Valencia Date: Mon, 25 Apr 2016 06:07:31 -0500 Subject: [PATCH] Third-party installers updated. --- appli/bash/cpPlugins_ExecuteWorkspace.cxx | 33 ++++++++ .../cpPlugins_Install_CMAKE.sh | 69 +++++++++++++++++ .../cpPlugins_Install_ITK.sh | 3 +- .../cpPlugins_Install_QT4.sh | 20 ++++- .../cpPlugins_Install_VTK.sh | 77 ++++++++++++++++--- 5 files changed, 185 insertions(+), 17 deletions(-) create mode 100644 appli/bash/cpPlugins_ExecuteWorkspace.cxx create mode 100755 third_party_installers/cpPlugins_Install_CMAKE.sh diff --git a/appli/bash/cpPlugins_ExecuteWorkspace.cxx b/appli/bash/cpPlugins_ExecuteWorkspace.cxx new file mode 100644 index 0000000..4c847b1 --- /dev/null +++ b/appli/bash/cpPlugins_ExecuteWorkspace.cxx @@ -0,0 +1,33 @@ +#include +#include +#include +#include +#include + +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 index 0000000..61f0580 --- /dev/null +++ b/third_party_installers/cpPlugins_Install_CMAKE.sh @@ -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$ diff --git a/third_party_installers/cpPlugins_Install_ITK.sh b/third_party_installers/cpPlugins_Install_ITK.sh index d9ca4ff..8af7e09 100755 --- a/third_party_installers/cpPlugins_Install_ITK.sh +++ b/third_party_installers/cpPlugins_Install_ITK.sh @@ -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 \ diff --git a/third_party_installers/cpPlugins_Install_QT4.sh b/third_party_installers/cpPlugins_Install_QT4.sh index cb3afc3..7f761cf 100755 --- a/third_party_installers/cpPlugins_Install_QT4.sh +++ b/third_party_installers/cpPlugins_Install_QT4.sh @@ -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..." diff --git a/third_party_installers/cpPlugins_Install_VTK.sh b/third_party_installers/cpPlugins_Install_VTK.sh index 59c3b8a..a1ed2fc 100755 --- a/third_party_installers/cpPlugins_Install_VTK.sh +++ b/third_party_installers/cpPlugins_Install_VTK.sh @@ -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 \ -- 2.47.1