Binary archives

When creating binary archives, CPack will package the contents of the targets described in our CMakeCPack.cmake file as described by the installation instructions. Thus in our example the hello-world executable, the message shared library, and the corresponding header files will all be packaged in the .tar.gz and .zip formats. In addition, also the CMake configuration files will be packaged. This is very useful for other projects that will need to link against our library. The installation prefix used in the package may differ from the one used when installing the project from the build tree. The CPACK_PACKAGING_INSTALL_PREFIX variable may be used to achieve this. In our example, we set it to a specific location on the system: ...

Get CMake Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.