Doxygen¶
Setting up a Doxygen run as a build target.
- qm_setup_doxygen¶
Add Doxygen documentation generating target.
qm_setup_doxygen(<target> [NAME <name>] [VERSION <version>] [DESCRIPTION <desc>] [LOGO <file>] [MDFILE <file>] [OUTPUT_DIR <dir>] [INSTALL_DIR <dir>] [TAGFILES <file> ...] [GENERATE_TAGFILE <file>] [INPUT <file> ...] [INCLUDE_DIRECTORIES <dir> ...] [COMPILE_DEFINITIONS <NAME=VALUE> ...] [TARGETS <target> ...] [ENVIRONMENT_EXPORTS <key> ...] [NO_EXPAND_MACROS <macro> ...] [DEPENDS <dependency> ...] )
<target>the custom target to add. It is not part of
all, so the documentation is built by asking for it by name.NAMEwhat the documentation calls the project, defaulting to
PROJECT_NAMEVERSIONthe version shown, defaulting to
PROJECT_VERSIONDESCRIPTIONthe one line brief, defaulting to
PROJECT_DESCRIPTIONand then to the nameLOGOan image for the corner of the page
MDFILEa markdown file to use as the main page, added to the input as well
OUTPUT_DIRwhere the HTML is written, defaulting to a directory named after the target under the current binary directory
INSTALL_DIRwhere to install the HTML. Relative to the install prefix. Without it nothing is installed, and with it the documentation is built again while installing rather than taken from wherever the target left it.
TAGFILEStag files of other projects to link against
GENERATE_TAGFILEwrite a tag file of this project, for another to link against. The directory is made if it is not there.
INPUTwhat Doxygen reads
INCLUDE_DIRECTORIESadded to Doxygen’s include path, for resolving what the sources include
COMPILE_DEFINITIONSmacros Doxygen preprocesses with, as
NAME=VALUETARGETStargets to take the include directories and compile definitions off, so that what Doxygen preprocesses with is what the build compiles with. Read through generator expressions, so a target’s own usage requirements come too.
ENVIRONMENT_EXPORTSnames of CMake variables to put in the environment Doxygen runs under, for a
Doxyfilethat reads them. A name that is not set stops the configure.NO_EXPAND_MACROSmacros to expand to nothing, for the ones that would otherwise confuse the parser.
Q_OBJECTand friends are what this is for.DEPENDStargets to build before this one runs
Note
Doxygen has to be found before this is called,
find_package(Doxygen)being what sets theDOXYGEN_EXECUTABLEthis reads. A call made without one stops with an error saying so.qm_import(Doxygen) find_package(Doxygen REQUIRED) qm_setup_doxygen(${PROJECT_NAME}_RunDoxygen NAME ${PROJECT_NAME} DESCRIPTION "my project" MDFILE "${CMAKE_SOURCE_DIR}/README.md" OUTPUT_DIR "${CMAKE_BINARY_DIR}/doc" INPUT src TARGETS ${PROJECT_NAME} NO_EXPAND_MACROS Q_OBJECT Q_GADGET INSTALL_DIR "doc" )
Where this page comes from
The comments in cmake/modules/Doxygen.cmake, which is what to change.