linux_quick_install_contrib.sh 700 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. # This file contains documentation snippets for Linux installation tutorial
  3. if [ "$1" = "--check" ] ; then
  4. sudo()
  5. {
  6. command $@
  7. }
  8. fi
  9. # [body]
  10. # Install minimal prerequisites (Ubuntu 18.04 as reference)
  11. sudo apt update && sudo apt install -y cmake g++ wget unzip
  12. # Download and unpack sources
  13. wget -O opencv.zip https://github.com/opencv/opencv/archive/4.x.zip
  14. wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.x.zip
  15. unzip opencv.zip
  16. unzip opencv_contrib.zip
  17. # Create build directory and switch into it
  18. mkdir -p build && cd build
  19. # Configure
  20. cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-4.x/modules ../opencv-4.x
  21. # Build
  22. cmake --build .
  23. # [body]