diff --git a/CMakeLists.txt b/CMakeLists.txt index 3035755..5e06f36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,3 +99,28 @@ if (CPPZMQ_BUILD_TESTS) add_subdirectory(examples) endif() endif() + + +############# +# Packaging # +############# + +include(InstallRequiredSystemLibraries) +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") +set(CPACK_GENERATOR "DEB") +set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Daniel Fundarek") +set(CPACK_PACKAGE_DESCRIPTION + "cppzmq project provides a C++ binding for the libzmq library. + Installation of cppzmq debian package also installs libzmq3-dev as dependency.") +set(CPACK_PACKAGE_CONTACT "daniel.fundarek@airvolute.com") +set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) +set(CPACK_DEBIAN_PACKAGE_DEPENDS + "libzmq3-dev" +) + +set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA +) +set(CPACK_SET_DESTDIR OFF) +set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local") + +include(CPack) \ No newline at end of file diff --git a/README.md b/README.md index 5d804d0..f0b1d17 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,20 @@ Build instructions ================== Build steps: +1.Install libzmq from apt repository + - `sudo apt install libzmq3-dev` +2. Build cppzmq via cmake, pack with cpack, and install the Debian package via apt. + - `git clone https://github.com/zeromq/cppzmq.git` + - `cd cppzmq` + - `mkdir build` + - `cd build` + - `cmake ..` + - `make -j$(nproc)` + - `cpack` + - `sudo apt install ./cppzmq*.deb` + + +or use legacy build: 1. Build [libzmq](https://github.com/zeromq/libzmq) via cmake. This does an out of source build and installs the build files - `git clone https://github.com/zeromq/libzmq.git`