Making CMake targets installable
In the context of CMake, there is a difference between the terms installing and packaging software. Installing software involves copying executable files, libraries, and other necessary resources to a predefined location. Packaging, on the other hand, involves bundling all necessary files and dependencies into a distributable format (such as a tarball, ZIP archive, or installer package) for easy distribution and installation on other systems. CMake’s packaging mechanism works by first installing a project in a temporary location and then packaging the installed files into a suitable format.
The most primitive way of supporting deployment in a project is by making it installable. On the contrary, the end user still must acquire the project’s source code and build it from scratch. An installable project has extra build system code for installing the runtime or development artifacts on the system. The build system will perform the install...