At first, it is recommended to generate a default Doxyfile and then edit the necessary settings within the file.įor our compatibility with the CMake file, we have to set the input (where is the source code and other files to generate the documentation from) and the output (where the result doc files will be rendered). The Doxyfile.in contains the Doxygen parameters and setting for a build. If we only want the documentation to be generated in Release mode, then we can embrace the above code snippet by: if (CMAKE_BUILD_TYPE MATCHES "^elease" ) # build the docs ![]() Set(DOXYGEN_IN $ COMMENT "Generating API documentation with Doxygen" VERBATIM ) else (DOXYGEN_FOUND) message( "Doxygen need to be installed to generate the doxygen documentation" ) endif (DOXYGEN_FOUND) Option(BUILD_DOC "Build documentation" ON) # check if Doxygen is installedįind_package(Doxygen) if (DOXYGEN_FOUND) # set input and output files To make the Doxygen to build documentation from the CMake file, the following code snipped can be used: # first we can indicate the documentation build as an option and set it to ON by default Lets say I would like my documentation to be built inside the build-folder. src: CMakeLists.txt, all the source files (e.g.cpp and.To provide an outline, this is the repository structure for which I want to build the documentation: The official Doxygen site contains plenty of information on how to use the Doxygen syntax so that to generate *.html files of documentation. It should contain some user documentation files (of Markdown origin) which are not located with the source folder. ![]() It should only be generated in Release mode.The documentation should be generated by a CMake file.For reference, the project size is about 7-8K lines. It was finally time to set up API documentation for one of my projects.
0 Comments
Leave a Reply. |