diff --git a/samples/qt/FuncDemo/env.sh b/samples/qt/FuncDemo/env.sh index f081139a1a..616847c074 100644 --- a/samples/qt/FuncDemo/env.sh +++ b/samples/qt/FuncDemo/env.sh @@ -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} diff --git a/samples/qt/FuncDemo/make.sh b/samples/qt/FuncDemo/make.sh index 8fc47f63c9..1b771ffbe0 100644 --- a/samples/qt/FuncDemo/make.sh +++ b/samples/qt/FuncDemo/make.sh @@ -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 diff --git a/samples/qt/FuncDemo/run.sh b/samples/qt/FuncDemo/run.sh index 8129d8f69c..9e12027359 100644 --- a/samples/qt/FuncDemo/run.sh +++ b/samples/qt/FuncDemo/run.sh @@ -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` diff --git a/samples/qt/IESample/env.sh b/samples/qt/IESample/env.sh index eef770d4ef..66610d7150 100755 --- a/samples/qt/IESample/env.sh +++ b/samples/qt/IESample/env.sh @@ -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} diff --git a/samples/qt/IESample/make.sh b/samples/qt/IESample/make.sh index ef84e31e77..b6528143f2 100755 --- a/samples/qt/IESample/make.sh +++ b/samples/qt/IESample/make.sh @@ -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 diff --git a/samples/qt/IESample/run.sh b/samples/qt/IESample/run.sh index a9374a3133..29c300b166 100755 --- a/samples/qt/IESample/run.sh +++ b/samples/qt/IESample/run.sh @@ -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` diff --git a/samples/qt/Tutorial/env.sh b/samples/qt/Tutorial/env.sh index eef770d4ef..66610d7150 100755 --- a/samples/qt/Tutorial/env.sh +++ b/samples/qt/Tutorial/env.sh @@ -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} diff --git a/samples/qt/Tutorial/make.sh b/samples/qt/Tutorial/make.sh index 791c414b9a..2a4169279b 100644 --- a/samples/qt/Tutorial/make.sh +++ b/samples/qt/Tutorial/make.sh @@ -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 diff --git a/samples/qt/Tutorial/run.sh b/samples/qt/Tutorial/run.sh index c06f3fed5e..d314656906 100755 --- a/samples/qt/Tutorial/run.sh +++ b/samples/qt/Tutorial/run.sh @@ -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`