Packaging and distributing documentation with CPack
Packaging documentation is no different than packaging software and its artifacts—documentation is an artifact of a project, after all. Thus, we will use the techniques we learned in Chapter 4, Packaging, Deploying, and Installing a CMake Project, to package our documentation.
Note
If you have not read Chapter 4, Packaging, Deploying, and Installing a CMake Project, yet, it is strongly recommended to do so before reading this section.
For illustrating this section, we will return to Chapter 6 - Example 01. We will make the documentation we have generated in this example installable and packageable. Let's dive back into the CMakeLists.txt
file located in the chapter_6/ex01_doxdocgen/
folder. With the following code, we will make the HTML and MAN
documentation installable:
include(GNUInstallDirs) install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/docs/html/" DESTINATION "${CMAKE_INSTALL_DOCDIR...