| 1 | CMake Example |
| 2 | ============= |
| 3 | |
| 4 | This example project demonstrates how to use dh-cmake's CPack functionality. It |
| 5 | can be built out of the box with dpkg-buildpackage. |
| 6 | |
| 7 | Look in the `debian/rules` file. Notice the `--with cpack` parameter. This |
| 8 | enables the `cpack` Debhelper sequence, which runs the `dh_cpack_generate`, |
| 9 | `dh_cpack_substvars`, and `dh_cpack_install` commands. The generate step |
| 10 | generates a .json file containing the CPack metadata, the substvars step puts |
| 11 | this metadata into the packages' substvars, and the install step installs the |
| 12 | CPack components and component groups in the respective packages. |
| 13 | |
| 14 | The install step is very similar to `dh_cmake_install`, but it also supports |
| 15 | entire CPack groups. Look at `debian/libcpackexample.cpack-components` and |
| 16 | `debian/libcpackexample-dev.cpack-component-groups`, and compare these with the |
| 17 | `CMakeLists.txt` file. |
| 18 | |
| 19 | Now look at `debian/control`. Notice the use of `${cpack:Depends}` in the |
| 20 | `libcpackexample-dev` package. This variable makes use of CPack's own internal |
| 21 | dependency graph. Because the `Headers` and `Namelink` components depend on the |
| 22 | `Libraries` component, `libcpackexample-dev` will depend on `libcpackexample`. |