Making CMake targets installable
The most primitive way of supporting deployment in a project is by making it installable. The term installable here does not refer to installing a pre-made package of the software. On the contrary, the end user still has to acquire the source code for the project 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 action here, given that it has proper instructions on how to do so. Since we're using CMake to generate the build system files, CMake must generate the relevant install code. In this section, we will dive into the basics of how to instruct CMake to generate such code for the CMake targets.
The install() command
The install(...)
command is a built-in CMake command that allows you to generate build system instructions for installing targets, files, directories, and more. CMake will not generate install...