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 f081139..616847c 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 8fc47f6..1b771ff 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 8129d8f..9e12027 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 eef770d..66610d7 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 ef84e31..b652814 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 a9374a3..29c300b 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 eef770d..66610d7 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 791c414..2a41692 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 c06f3fe..d314656 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`