Search⌘ K

Installing and Packaging

Explore how to configure installation of static and shared libraries along with executables using CMake. Understand grouping artifacts into components, setting default install paths, generating reusable package files, and creating basic packages with CPack. This lesson enables you to install and package your C++ project efficiently for reuse and distribution.

We're starting with a quick overview of the files needed to set up installation and packaging:

Files configuring installation and packaging
Files configuring installation and packaging

Only files are needed here—most of the work is already done. As we may remember, the top-level listfile includes a CMake module that's going to handle this process:

...
include(Install)
Include module (From: CMakeLists.txt (fragment))

We're interested in installing two items:

  • The Calc library artifacts: the static library, the shared library, and header files, along with their target export file

  • The Calc console executable ...