]> Creatis software - cpPlugins.git/blobdiff - third_party_installers/cpPlugins_Install_CMAKE.sh
...
[cpPlugins.git] / third_party_installers / cpPlugins_Install_CMAKE.sh
index fafea8facb621bec50442cfeabf68fcee775fe12..a69b7f40433eb2949e31b18c1cf514c54a68e923 100755 (executable)
@@ -21,6 +21,25 @@ function abspath()
 ## Some configuration variables
 number_of_processes="-j4"
 
+# Locate qmake executable
+qmake_locations=("/usr/bin" "/usr/local/bin" "${HOME}/local/bin")
+qmake_exec=""
+for loc in ${qmake_locations[@]}; do
+    qmake_file="$loc/qmake"
+    if [ -x $qmake_file ]; then
+        version=`$qmake_file --version | grep Using\ Qt\ version | cut -d ' ' -f 4`
+        if [ "${version:0:3}" == "4.8" ]; then
+            qmake_exec=$qmake_file
+        fi
+    fi
+done
+
+if [ -x $qmake_exec ]; then
+    qt_options="--qt-gui --qt-qmake=$qmake_exec"
+else
+    qt_options="--no-qt-gui"
+fi
+
 ## Check input parameters and process inputs (if needed)
 if [ "$#" -eq 1 ]; then
     valid_extensions=("zip" "tar" "tar.gz" "tar.bz2")
@@ -71,7 +90,7 @@ echo "Given build dir  : \"$build_dir\""
 
 echo "Configuring sources... "
 cd $build_dir
-$source_dir/bootstrap --prefix=${HOME}/local
+$source_dir/bootstrap --prefix=${HOME}/local $qt_options
 echo "Configuring sources... done."
 
 echo "Compiling sources..."