setup_vars_opencv4.sh 670 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
  3. [[ ! "${OPENCV_QUIET}" ]] && ( echo "Setting vars for OpenCV 4.8.0" )
  4. export LD_LIBRARY_PATH="$SCRIPT_DIR/../lib:$LD_LIBRARY_PATH"
  5. if [[ ! "$OPENCV_SKIP_PYTHON" ]]; then
  6. PYTHONPATH_OPENCV="$SCRIPT_DIR/../lib/python3.8/site-packages"
  7. [[ ! "${OPENCV_QUIET}" ]] && ( echo "Append PYTHONPATH: ${PYTHONPATH_OPENCV}" )
  8. export PYTHONPATH="${PYTHONPATH_OPENCV}:$PYTHONPATH"
  9. fi
  10. # Don't exec in "sourced" mode
  11. if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
  12. if [[ $# -ne 0 ]]; then
  13. [[ ! "${OPENCV_QUIET}" && "${OPENCV_VERBOSE}" ]] && ( echo "Executing: $*" )
  14. exec "$@"
  15. fi
  16. fi