Summary
Navigating the intricacies of writing cross-platform installation scripts can be daunting, but CMake significantly simplifies this task. Although it requires some initial setup, CMake streamlines the process, integrating seamlessly with the concepts and techniques we’ve explored throughout this book.
We began by understanding how to export CMake targets from projects, enabling their use in other projects without installation. This was followed by insights into installing projects that are already configured for export. Delving into installation basics, we focused on a crucial aspect: installing CMake targets. We now have a grasp of how CMake allocates different destinations for various artifact types and the special considerations for public headers. We also examined other modes of the install()
command, encompassing the installation of files, programs, and directories, and executing scripts during installation.
Our journey then led us to CMake’s reusable...