Debian Codegraph @

script/install

raw
1 #!/bin/bash
2 ###############################################################################
3 # Copyright (C) Intel Corporation
4 #
5 # SPDX-License-Identifier: MIT
6 ###############################################################################
7 # Install the product.
8 #
9 # If argument is provided then it will be interpreted as the install prefix. If
10 # called without arguments then installation will be to `VPL_INSTALL_DIR` if
11 # defined or system default location otherwise.
12
13 set -o errexit
14
15 if [ -z "$BASH_VERSION" ]; then
16 echo "This script must be run under bash"
17 exit 1
18 fi
19
20 script_dir="$( cd "$(dirname "${BASH_SOURCE[0]:-$0}")" >/dev/null 2>&1 ; pwd -P )"
21
22 source_dir="$(dirname "$script_dir")"
23 build_dir="$source_dir/_build"
24
25 if [ -n "$1" ]; then
26 # use first argument as install prefix
27 cmake --install "$build_dir" --config Release --strip --prefix "$1"
28 elif [ -z ${VPL_INSTALL_DIR+x} ]; then
29 # no argument or env variable defined, use system default install location
30 cmake --install "$build_dir" --config Release --strip
31 else
32 # no argument but env variable was provided, install to VPL_INSTALL_DIR
33 cmake --install "$build_dir" --config Release --strip --prefix "$VPL_INSTALL_DIR"
34 fi