Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added setup.sh for installation : Issue #129 Fixed #130

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,17 @@ git clone https://github.com/SRA-VJTI/Pixels_Seminar.git
```sh
cd Pixels_Seminar
```

* Run the installation script
```sh
make install
```

* If unable to run above script, run this script
```sh
chmod +x setup.sh
./setup.sh
```

Installation is done successfully.

26 changes: 26 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# Check if OpenCV is installed
echo "Checking if OpenCV is installed..."
if pkg-config --exists opencv4 sdl2; then
echo "OpenCV is installed"
else
echo "OpenCV is not installed"
echo "Installing OpenCV..."

# Detect OS and install dependencies accordingly
if grep -qi "debian" /etc/os-release; then
echo "Detected Debian-based system"
sudo apt-get update -y
sudo apt-get install build-essential libopencv-dev libsdl2-2.0-0 libsdl2-image-dev libsdl2-dev -y
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "Detected macOS"
brew install opencv sdl2
elif grep -qi "arch" /etc/os-release; then
echo "Detected Arch Linux"
sudo pacman -Sy base-devel opencv hdf5 glew vtk fmt sdl2
else
echo "Unknown OS, cannot install OpenCV"
exit 1
fi
fi