Additional complexity of the task was that I needed to make a package only for that library and not for the entire SDK. In my case I needed to make a deb package for one of the libraries of our SDK, so deb package format will be the main focus of this article. Instead of dealing with every single package format structure and requirements “manually”, you can let CPack handle all of them, so you’ll only need to worry about getting the actual package contents together.
Quite often it’s just a ZIP archive, but it can be also something more sophisticated, such as a package in one of the package management system formats, such as NuGet, RPM, deb and so on.ĬPack comes especially handy if you need to support more than one package format. The package is simply a “distribution unit” - something that you share with your users, or, in other words, what form your library/SDK/application is delivered in. While CMake handles building the project, CPack is responsible for making packages. This time I was tasked with creating a deb package for one of the libraries in our SDK.Īnd what would you know, CMake can handle packaging too - with CPack utility.ĬPack, like CMake itself, is a CLI program. Last time I needed to handle a C++ library project with CMake.