3 ## Some configuration variables
4 number_of_processes="-j4"
7 ## Locate cmake executable
8 cmake_exec="/usr/bin/cmake"
9 if [ ! -x $cmake_exec ]; then
10 cmake_exec="/usr/local/bin/cmake"
12 if [ ! -x $cmake_exec ]; then
13 cmake_exec="${HOME}/local/bin/cmake"
15 if [ ! -x $cmake_exec ]; then
16 echo "$0: modify this script to put the correct location of cmake."
20 ## Locate qmake executable
21 qmake_dirs=("/usr/bin" "/usr/local/bin" "${HOME}/local/bin")
23 for dir in ${qmake_dirs[@]}; do
28 # qmake_exec="/usr/bin/qmake"
30 # if [ -x $qmake_exec ]; then
31 # version=`$qmake_exec --version | grep Using\ Qt\ version`
32 # number=`expr substr "$version" 18 1`
36 # if [ "$number" -ne "4" ]; then
41 # if [ "x$qmake_exec" != "x" ]; then
42 # qmake_exec="/usr/local/bin/qmake"
43 # if [ ! -x $qmake_exec ]; then
45 # if [ -x $qmake_exec ]; then
46 # version=`$qmake_exec --version | grep Using\ Qt\ version`
47 # number=`expr substr "$version" 18 1`
49 # if [ "$number" -ne "4" ]; then
58 # if [ "x$qmake_exec" != "x" ]; then
59 # qmake_exec="${HOME}/local/bin/qmake"
60 # if [ ! -x $qmake_exec ]; then
62 # if [ -x $qmake_exec ]; then
63 # version=`$qmake_exec --version | grep Using\ Qt\ version`
64 # number=`expr substr "$version" 18 1`
67 # if [ "$number" -ne "4" ]; then
76 # if [ ! -x $qmake_exec ]; then
77 # echo "$0: modify this script to put the correct location of qmake."
84 ## Check input parameters and process inputs (if needed)
85 if [ "$#" -eq 1 ]; then
86 valid_extensions=("zip" "tar" "tar.gz" "tar.bz2")
88 for ext in ${valid_extensions[@]}; do
89 if [ `basename $1 $ext` != $1 ]; then
93 if [ "x$actual_ext" == "x" ]; then
94 echo "$0: Invalid file type."
97 canonical_path=`readlink -e $1`
98 source_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`
99 build_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`-build
100 echo -n "Cleaning directories... "
104 echo -n "Creating directories... "
108 echo -n "Extracting sources... "
109 if [ "$actual_ext" == "zip" ]; then
110 echo unzip $canonical_path
111 elif [ "$actual_ext" == "tar" ]; then
112 tar xf $canonical_path -C $source_dir --strip-components=1
113 elif [ "$actual_ext" == "tar.gz" ]; then
114 tar xzf $canonical_path -C $source_dir --strip-components=1
115 elif [ "$actual_ext" == "tar.bz2" ]; then
116 tar xjf $canonical_path -C $source_dir --strip-components=1
118 echo "$0: Invalid file type."
122 elif [ "$#" -eq 2 ]; then
123 source_dir=`dirname $1`
124 build_dir=`dirname $2`
126 echo "Usage: [vtk_package] or [vtk_source_dir vtk_build_dir]"
129 echo "Given source dir : \"$source_dir\""
130 echo "Given build dir : \"$build_dir\""
132 echo "Configuring sources... "
135 -DCMAKE_CXX_FLAGS:STRING=-std=c++11 \
136 -DBUILD_DOCUMENTATION:BOOL=OFF \
137 -DBUILD_EXAMPLES:BOOL=OFF \
138 -DBUILD_SHARED_LIBS:BOOL=ON \
139 -DBUILD_TESTING:BOOL=OFF \
140 -DQT_QMAKE_EXECUTABLE:PATH=$qmake_exec \
141 -DCMAKE_BUILD_TYPE:STRING=$comp_type \
142 -DModule_vtkGUISupportQt:BOOL=ON \
143 -DModule_vtkGUISupportQtOpenGL:BOOL=ON \
144 -DModule_vtkGUISupportQtSQL:BOOL=OFF \
145 -DModule_vtkGUISupportQtWebkit:BOOL=OFF \
146 -DCMAKE_INSTALL_PREFIX:PATH=${HOME}/local \
148 echo "Configuring sources... done."
150 echo "Compiling sources..."
152 make $number_of_processes
153 echo "Compiling sources... done."
155 echo "Installing package..."
158 echo "Installing package... done."