Creating an installable package with CPack
So far, we have seen how CMake can structure software projects. Although CMake is the star of the show, CMake has some powerful friends too. It is time to introduce you to CPack, the packaging tool of CMake. It is shipped with CMake installations by default. It allows you to leverage existing CMake code to generate platform-specific installations and packages. CPack is similar to CMake in concept. It is based on generators that generate packages instead of build system files. The following table shows the available CPack generator types, as of CPack version 3.21.3:
CPack uses CMake's installation mechanism to populate the content of the packages. CPack uses the configuration details that are present in the CPackConfig.cmake
and CPackSourceConfig.cmake
files to generate packages. These files can either be populated manually or generated automatically by CMake with the help of the CPack...