Installing and packaging
Figure 15.6 shows where we’ll configure our project for installation and packaging:
Figure 15.6: File configuring installation and packaging
The top-level listfile includes the Packaging
utility module:
ch15/01-full-project/CMakeLists.txt (fragment)
# ... configure project
# ... enable testing
# ... include src and test subdirectories
include(Packaging)
The Packaging
module details the package configuration for the project, which we will explore in the Packaging with CPack section. Our focus now is on installing three main components:
- The Calc library artifacts: static and shared libraries, header files, and target export files
- The package definition config file for the Calc library
- The Calc console executable
Everything is planned, so it’s time to configure the installation of the library.
Installation of the library
To install the library, we start by defining logical targets...