Compile and installation method updates

created setup, build and install scripts to make it easier and
convenient to compile and install the application from source. no plans
distribute pre-compiled binaries because it's just so much easier to
guarantee the application will actually work in the target machine when
compiled by the target machine.
This commit is contained in:
Maurice ONeal 2022-09-17 09:53:52 -04:00
parent 2687b938a0
commit 64fe9fcad0
6 changed files with 43 additions and 11 deletions

8
.gitignore vendored
View File

@ -55,5 +55,9 @@ compile_commands.json
# VSCode
/.vscode
# Build folder
/build
# Build folders
/.build-mow
/.build-opencv
# Opencv src folder
/src/opencv

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 2.8.12)
project( MotionWatch )
find_package( OpenCV REQUIRED )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pthread")

View File

@ -90,17 +90,22 @@ vid_container = mp4
# installation.
```
### Build Setup ###
### Setup/Build/Install ###
This application is currently only compatible with a Linux based operating
systems that are capable of building and installing the opencv API from source.
[opencv](https://docs.opencv.org/4.x/df/d65/tutorial_table_of_content_introduction.html).
The following 3 scripts make this convenient by downloading, compiling and then
installing the opencv API for you directly from opencv's git repository. This
also makes sure FFMPEG and all of it's dependencies are installed because this
application needs it to work properly.
note 1: be sure to run setup.sh and install.sh as root (or use sudo).
note 2: if building from scratch the following scripts will need to
be run in this order - setup.sh -> build.sh -> install.sh.
```
cd /path/to/Motion/Watch/source
mkdir ./build
cd ./build
cmake ..
make
sudo cp ./mow /usr/bin/mow
sh ./setup.sh <--- only need to run this once if compiling for the first
sh ./build.sh time or if upgrading from the ground up.
sh ./install.sh
```

7
build.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/sh
mkdir -p ./.build-mow
cd ./.build-mow
cmake ..
make -j4

3
install.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
cp ./.build-mow/mow /usr/bin/mow

13
setup.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/sh
apt update
apt install -y cmake g++ wget unzip git ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev
cd ./src
git clone https://github.com/opencv/opencv.git
cd ..
mkdir -p ./.build-opencv
cd ./.build-opencv
cmake ../src/opencv
make -j4
make install