diff --git a/setup_opencv.sh b/setup_opencv.sh index b09068e657..c6fbedc0e9 100644 --- a/setup_opencv.sh +++ b/setup_opencv.sh @@ -38,10 +38,18 @@ workspace_file="$( cd "$(dirname "$0")" ; pwd -P )"/WORKSPACE if [ -z "$1" ] then echo "Installing OpenCV from source" - sudo apt update && sudo apt install build-essential git - sudo apt install cmake ffmpeg libavformat-dev libdc1394-22-dev libgtk2.0-dev \ - libjpeg-dev libpng-dev libswscale-dev libtbb2 libtbb-dev \ - libtiff-dev + if [[ -x "$(command -v apt)" ]]; then + sudo apt update && sudo apt install build-essential git + sudo apt install cmake ffmpeg libavformat-dev libdc1394-22-dev libgtk2.0-dev \ + libjpeg-dev libpng-dev libswscale-dev libtbb2 libtbb-dev \ + libtiff-dev + elif [[ -x "$(command -v dnf)" ]]; then + sudo dnf update && sudo dnf install cmake gcc gcc-c++ git + sudo dnf install ffmpeg-devel libdc1394-devel gtk2-devel \ + libjpeg-turbo-devel libpng-devel tbb-devel \ + libtiff-devel + fi + rm -rf /tmp/build_opencv mkdir /tmp/build_opencv cd /tmp/build_opencv