2020-10-08 05:35:06 +08:00
|
|
|
#!/bin/bash
|
|
|
|
# This file contains documentation snippets for Linux installation tutorial
|
|
|
|
if [ "$1" = "--check" ] ; then
|
|
|
|
sudo()
|
|
|
|
{
|
|
|
|
command $@
|
|
|
|
}
|
|
|
|
fi
|
|
|
|
|
|
|
|
# [body]
|
|
|
|
# Install minimal prerequisites (Ubuntu 18.04 as reference)
|
|
|
|
sudo apt update && sudo apt install -y cmake g++ wget unzip
|
|
|
|
|
|
|
|
# Download and unpack sources
|
2021-12-31 00:23:27 +08:00
|
|
|
wget -O opencv.zip https://github.com/opencv/opencv/archive/5.x.zip
|
2020-10-08 05:35:06 +08:00
|
|
|
unzip opencv.zip
|
|
|
|
|
|
|
|
# Create build directory
|
|
|
|
mkdir -p build && cd build
|
|
|
|
|
|
|
|
# Configure
|
2021-12-31 00:23:27 +08:00
|
|
|
cmake ../opencv-5.x
|
2020-10-08 05:35:06 +08:00
|
|
|
|
|
|
|
# Build
|
|
|
|
cmake --build .
|
|
|
|
# [body]
|