]> OCCT Git - occt-copy.git/commitdiff
0029083: Samples - specify multiple Make jobs within make.sh for Qt sample
authorkgv <kgv@opencascade.com>
Mon, 4 Sep 2017 16:02:49 +0000 (19:02 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 7 Sep 2017 14:08:23 +0000 (17:08 +0300)
samples/qt/FuncDemo/env.sh
samples/qt/FuncDemo/make.sh
samples/qt/FuncDemo/run.sh
samples/qt/IESample/env.sh
samples/qt/IESample/make.sh
samples/qt/IESample/run.sh
samples/qt/Tutorial/env.sh
samples/qt/Tutorial/make.sh
samples/qt/Tutorial/run.sh

index f081139a1a973d52779e34757e6d865a22c6f69e..616847c07460f7468228f176c636913018de3bec 100644 (file)
@@ -3,19 +3,24 @@
 export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
 if [ -e "custom.sh" ]; then
-   source "custom.sh";
+  source "custom.sh" $*;
 fi
 
 if [ -e "${aSamplePath}/../../../env.sh" ]; then
-   source "${aSamplePath}/../../../env.sh";
+  source "${aSamplePath}/../../../env.sh" $*;
 fi
 
-if test "${QTDIR}" == ""; then
-   echo "Environment variable \"QTDIR\" not defined. Define it in \"custom.sh\" script."
-   exit 1
+if [ "${QTDIR}" != "" ]; then
+  export PATH=${QTDIR}/bin:${PATH}
+else
+  aQMakePath=`which qmake`
+  echo "Environment variable \"QTDIR\" not defined.. Define it in \"custom.sh\" script."
+  if [ -x "$aQMakePath" ]; then
+    echo "qmake from PATH will be used instead."
+  else
+    exit 1
+  fi
 fi
 
 host=`uname -s`
 export STATION=$host
-
-export PATH=${QTDIR}/bin:${PATH}
index 8fc47f63c93858bd3c3e15d2fb9cc9d8815ace13..1b771ffbe07f38adf0bd1f917c6749908cc13272 100644 (file)
@@ -1,13 +1,14 @@
 #!/bin/bash
 
 export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh"; fi
+if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh" $*; fi
 cd $aSamplePath
 qmake FuncDemo.pro
 if [ "$(uname -s)" != "Darwin" ] || [ "$MACOSX_USE_GLX" == "true" ]; then
+  aNbJobs="$(getconf _NPROCESSORS_ONLN)"
   if [ "${CASDEB}" == "d" ]; then
-    make debug
+    make -j $aNbJobs debug
   else
-    make release
+    make -j $aNbJobs release
   fi
 fi
index 8129d8f69c41656d766f930b00bf9ada7b6b8ceb..9e120273592ac288b353783fabfdc12b16b3a527 100644 (file)
@@ -2,7 +2,7 @@
 
 export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
-if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh"; fi
+if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh" $*; fi
 cd $aSamplePath
 
 aSystem=`uname -s`
index eef770d4efc70531fa51f94aefe7f6e31f02d90d..66610d7150fc7e47bbb5547620aa438eb0c01571 100755 (executable)
@@ -3,20 +3,25 @@
 export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
 if [ -e "custom.sh" ]; then
-   source "custom.sh";
+  source "custom.sh" $*;
 fi
 
 if [ -e "${aSamplePath}/../../../env.sh" ]; then
-   source "${aSamplePath}/../../../env.sh";
+  source "${aSamplePath}/../../../env.sh" $*;
 fi
 
-if test "${QTDIR}" == ""; then
-   echo "Environment variable \"QTDIR\" not defined. Define it in \"custom.sh\" script."
-   exit 1
+if [ "${QTDIR}" != "" ]; then
+  export PATH=${QTDIR}/bin:${PATH}
+else
+  aQMakePath=`which qmake`
+  echo "Environment variable \"QTDIR\" not defined.. Define it in \"custom.sh\" script."
+  if [ -x "$aQMakePath" ]; then
+    echo "qmake from PATH will be used instead."
+  else
+    exit 1
+  fi
 fi
 
 host=`uname -s`
 export STATION=$host
 export RES_DIR=${aSamplePath}/${STATION}/res
-
-export PATH=${QTDIR}/bin:${PATH}
index ef84e31e77c14127075a86cb46bf6a6db9d62ffa..b6528143f2a5f805371e7294b433db6eaa1e16bf 100755 (executable)
@@ -1,13 +1,14 @@
 #!/bin/bash
 
 export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh"; fi
+if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh" $*; fi
 cd $aSamplePath
 qmake IESample.pro
 if [ "$(uname -s)" != "Darwin" ] || [ "$MACOSX_USE_GLX" == "true" ]; then
+  aNbJobs="$(getconf _NPROCESSORS_ONLN)"
   if [ "${CASDEB}" == "d" ]; then
-    make debug
+    make -j $aNbJobs debug
   else
-    make release
+    make -j $aNbJobs release
   fi
 fi
index a9374a31338b01ebee5e81115a2889755da87406..29c300b1664adb69a5115b27758373c3b2f444a1 100755 (executable)
@@ -2,7 +2,7 @@
 
 export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
-if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh"; fi
+if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh" $*; fi
 cd $aSamplePath
 
 aSystem=`uname -s`
index eef770d4efc70531fa51f94aefe7f6e31f02d90d..66610d7150fc7e47bbb5547620aa438eb0c01571 100755 (executable)
@@ -3,20 +3,25 @@
 export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
 if [ -e "custom.sh" ]; then
-   source "custom.sh";
+  source "custom.sh" $*;
 fi
 
 if [ -e "${aSamplePath}/../../../env.sh" ]; then
-   source "${aSamplePath}/../../../env.sh";
+  source "${aSamplePath}/../../../env.sh" $*;
 fi
 
-if test "${QTDIR}" == ""; then
-   echo "Environment variable \"QTDIR\" not defined. Define it in \"custom.sh\" script."
-   exit 1
+if [ "${QTDIR}" != "" ]; then
+  export PATH=${QTDIR}/bin:${PATH}
+else
+  aQMakePath=`which qmake`
+  echo "Environment variable \"QTDIR\" not defined.. Define it in \"custom.sh\" script."
+  if [ -x "$aQMakePath" ]; then
+    echo "qmake from PATH will be used instead."
+  else
+    exit 1
+  fi
 fi
 
 host=`uname -s`
 export STATION=$host
 export RES_DIR=${aSamplePath}/${STATION}/res
-
-export PATH=${QTDIR}/bin:${PATH}
index 791c414b9af7b64eedd97147201441073224c023..2a4169279b8aa0262bc44e2fbe601f808cb857bc 100644 (file)
@@ -1,13 +1,14 @@
 #!/bin/bash
 
 export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh"; fi
+if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh" $*; fi
 cd $aSamplePath
 qmake Tutorial.pro
 if [ "$(uname -s)" != "Darwin" ] || [ "$MACOSX_USE_GLX" == "true" ]; then
+  aNbJobs="$(getconf _NPROCESSORS_ONLN)"
   if [ "${CASDEB}" == "d" ]; then
-    make debug
+    make -j $aNbJobs debug
   else
-    make release
+    make -j $aNbJobs release
   fi
 fi
index c06f3fed5e77f2d4041aa8a8af27a9cb2f43e4e9..d314656906bc5d4ee09dd177f3be7250368c2a72 100755 (executable)
@@ -2,7 +2,7 @@
 
 export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
-if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh"; fi
+if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh" $*; fi
 cd $aSamplePath
 
 aSystem=`uname -s`