This repository contains CMake with CPack build project for the OpenCV 4 library. It was created to accomodate the library packaging using the debian packaging system.
- Initialize and update the
opencv
submodule.$ git submodule init $ git submodule update
- Move to the
opencv
directory, pull the latest update, and checkout to the latest release tag.$ cd opencv $ git pull $ git checkout <latest-release>
- Change some variables value as follow:
- Change the value of
CPACK_DEBIAN_PACKAGE_VERSION
variable to match with the source code release version. - Increase the value of
CPACK_DEBIAN_PACKAGE_RELEASE
variable if there is changes related to the debian packaging with the same source code release version. else reset it to1
.
- Change the value of
- Create a
build
directory and move to it.$ mkdir build $ cd build
- Configure the Makefile rules with the following options.
$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..
- Build the library.
$ make
Note: you could speed up the build process with specifying the job count parameter using
-jn
wheren
is number of the jobs. (example:$ make -j4
) - Create debian package using cpack.
$ cpack