meta data for this page
  •  

Build an AMQP Client library and connect example application to a RabbitMQ Server on Debian

First it is explained to build a debian package containing a shared library from the sources of Copernica Marketing Software located on github. Then it is shown how package could be installed and used on an example C++ Eclipse project.

Build and install AMQP-CPP

Get the latest library by git clone https://github.com/CopernicaMarketingSoftware/AMQP-CPP.git

cd into AMQP-CPP and mkdir build and mkdir install open cmake-gui and set following:

Press configure and generate to create a makefile build environment. For examples to work and for later development the installation of following development libraries is necessary:

~# apt-get install libssl-dev libev-dev libuv1-dev libboost-dev libboost-system-dev 

Extend CMakelist.txt with a debian package generation with cpack:

IF (UNIX)
SET(CPACK_CMAKE_GENERATOR "Unix Makefiles")
SET(CPACK_SOURCE_GENERATOR "TGZ;TBZ2")
SET(CPACK_GENERATOR "DEB")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The AMQP shared library for C++")
SET(CPACK_PACKAGE_VENDOR "S.Meyer")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
SET(CPACK_PACKAGE_VERSION_MAJOR "4.1")
SET(CPACK_PACKAGE_VERSION_MINOR "3")
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}")
SET(CPACK_PACKAGE_CONTACT "Helloworld Team <team@helloworld.org>")
SET(CPACK_PACKAGE_SECTION "libs")
INCLUDE(CPack)
ENDIF (UNIX)
make package
dpkg -i