[CPP/SAMPLES] Samples location independant on script execution directory (#13251)

This commit is contained in:
Piotr Krzemiński 2022-10-20 10:01:55 +02:00 committed by GitHub
parent a0e2f14790
commit d715ecaa32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 8 deletions

View File

@ -14,7 +14,7 @@ usage() {
exit 1 exit 1
} }
samples_type=$(basename "$( dirname "${BASH_SOURCE[0]-$0}" )" ) samples_type="$(basename "$(dirname "$(realpath "${BASH_SOURCE[0]}")")")"
build_dir="$HOME/openvino_${samples_type}_samples_build" build_dir="$HOME/openvino_${samples_type}_samples_build"
sample_install_dir="" sample_install_dir=""
@ -52,8 +52,7 @@ error() {
} }
trap 'error ${LINENO}' ERR trap 'error ${LINENO}' ERR
SAMPLES_PATH="$( cd "$( dirname "${BASH_SOURCE[0]-$0}" )" && pwd )" SAMPLES_PATH="$( cd "$( dirname "$(realpath "${BASH_SOURCE[0]}")" )" && pwd )"
printf "\nSetting environment variables for building samples...\n" printf "\nSetting environment variables for building samples...\n"
if [ -z "$INTEL_OPENVINO_DIR" ]; then if [ -z "$INTEL_OPENVINO_DIR" ]; then

View File

@ -3,7 +3,7 @@
# Copyright (C) 2018-2022 Intel Corporation # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]-$0}" )" >/dev/null 2>&1 && pwd )" SCRIPT_DIR="$( cd "$( dirname "$(realpath "${BASH_SOURCE[0]}")" )" >/dev/null 2>&1 && pwd )"
echo "Updating udev rules..." echo "Updating udev rules..."

View File

@ -18,7 +18,7 @@ EXIT_WRONG_ARG=2
RHEL_VERSION= RHEL_VERSION=
UBUNTU_VERSION= UBUNTU_VERSION=
DISTRO= DISTRO=
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]-$0}" )" >/dev/null 2>&1 && pwd )" SCRIPT_DIR="$( cd "$( dirname "$(realpath "${BASH_SOURCE[0]}")" )" >/dev/null 2>&1 && pwd )"
INSTALL_DRIVER_VERSION='unknown' INSTALL_DRIVER_VERSION='unknown'

View File

@ -60,7 +60,7 @@ if [ -n "$selftest" ] ; then
echo "||" echo "||"
echo "|| Test $image / '$opt'" echo "|| Test $image / '$opt'"
echo "||" echo "||"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]-$0}" )" >/dev/null 2>&1 && pwd )" SCRIPT_DIR="$( cd "$( dirname "$(realpath "${BASH_SOURCE[0]}")" )" >/dev/null 2>&1 && pwd )"
docker run -it --rm \ docker run -it --rm \
--volume ${SCRIPT_DIR}:/scripts:ro,Z \ --volume ${SCRIPT_DIR}:/scripts:ro,Z \
--volume yum-cache:/var/cache/yum \ --volume yum-cache:/var/cache/yum \

View File

@ -3,7 +3,7 @@
# Copyright (C) 2018-2022 Intel Corporation # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]-$0}" )" >/dev/null 2>&1 && pwd )" SCRIPT_DIR="$( cd "$( dirname "$(realpath "${BASH_SOURCE[0]}")" )" >/dev/null 2>&1 && pwd )"
INSTALLDIR="${SCRIPT_DIR}" INSTALLDIR="${SCRIPT_DIR}"
export INTEL_OPENVINO_DIR="$INSTALLDIR" export INTEL_OPENVINO_DIR="$INSTALLDIR"

View File

@ -36,7 +36,7 @@ for ((i=1;i <= $#;i++)) {
} }
VENV_DIR="$HOME/venv_openvino" VENV_DIR="$HOME/venv_openvino"
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]-$0}" )" && pwd )" SCRIPTDIR="$( cd "$( dirname "$(realpath "${BASH_SOURCE[0]}")" )" && pwd )"
if [[ -f /etc/centos-release ]]; then if [[ -f /etc/centos-release ]]; then
DISTRO="centos" DISTRO="centos"