Commit c4085056382d242fdb1f9339c327c213572dbabd
1 parent
4660788c
Fixes for doxygen generation
Showing
4 changed files
with
36 additions
and
5 deletions
CMakeLists.txt
| ... | ... | @@ -60,7 +60,7 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) |
| 60 | 60 | endif() |
| 61 | 61 | endif() |
| 62 | 62 | |
| 63 | - if(CMAKE_VERSION VERSION_GREATER 3.6) | |
| 63 | + if(NOT CMAKE_VERSION VERSION_LESS 3.6) | |
| 64 | 64 | # Add clang-tidy if available |
| 65 | 65 | option(CLANG_TIDY_FIX "Perform fixes for Clang-Tidy" OFF) |
| 66 | 66 | find_program( |
| ... | ... | @@ -77,6 +77,17 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) |
| 77 | 77 | endif() |
| 78 | 78 | endif() |
| 79 | 79 | endif() |
| 80 | + | |
| 81 | + if(NOT CMAKE_VERSION VERSION_LESS 3.9) | |
| 82 | + find_package(Doxygen) | |
| 83 | + if(Doxygen_FOUND) | |
| 84 | + add_subdirectory(docs) | |
| 85 | + else() | |
| 86 | + message(STATUS "Doxygen not found, not building docs") | |
| 87 | + endif() | |
| 88 | + else() | |
| 89 | + message(STATUS "Newer CMake adds Doxygen support, update CMake for docs") | |
| 90 | + endif() | |
| 80 | 91 | else() |
| 81 | 92 | set(CUR_PROJ OFF) |
| 82 | 93 | endif() | ... | ... |
docs/CMakeLists.txt
0 → 100644
| 1 | +set(DOXYGEN_EXTRACT_ALL YES) | |
| 2 | +set(DOXYGEN_BUILTIN_STL_SUPPORT YES) | |
| 3 | +set(PROJECT_BRIEF "C++11 Command Line Interface Parser") | |
| 4 | + | |
| 5 | +file(GLOB DOC_LIST | |
| 6 | + RELATIVE "${PROJECT_SOURCE_DIR}/include" | |
| 7 | + "${PROJECT_SOURCE_DIR}/include/CLI/*.hpp" | |
| 8 | + ) | |
| 9 | + | |
| 10 | +doxygen_add_docs(docs | |
| 11 | + ${DOC_LIST} | |
| 12 | + "${CMAKE_CURRENT_SOURCE_DIR}/mainpage.md" | |
| 13 | + WORKING_DIRECTORY | |
| 14 | + "${PROJECT_SOURCE_DIR}/include" | |
| 15 | +) | |
| 16 | + | |
| 17 | + | |
| 18 | + | ... | ... |
docs/Doxyfile
| 1 | 1 | # Doxyfile 1.8.13 |
| 2 | 2 | |
| 3 | +# Designed to be run from the main directory with `doxygen docs/Doxygen` | |
| 4 | + | |
| 3 | 5 | # This file describes the settings to be used by the documentation system |
| 4 | 6 | # doxygen (www.doxygen.org) for a project. |
| 5 | 7 | # |
| ... | ... | @@ -790,7 +792,7 @@ WARN_LOGFILE = |
| 790 | 792 | # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING |
| 791 | 793 | # Note: If this tag is empty the current directory is searched. |
| 792 | 794 | |
| 793 | -INPUT = ../include mainpage.md | |
| 795 | +INPUT = include docs/mainpage.md | |
| 794 | 796 | |
| 795 | 797 | # This tag can be used to specify the character encoding of the source files |
| 796 | 798 | # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses |
| ... | ... | @@ -982,7 +984,7 @@ FILTER_SOURCE_PATTERNS = |
| 982 | 984 | # (index.html). This can be useful if you have a project on for instance GitHub |
| 983 | 985 | # and want to reuse the introduction page also for the doxygen output. |
| 984 | 986 | |
| 985 | -USE_MDFILE_AS_MAINPAGE = mainpage.md | |
| 987 | +USE_MDFILE_AS_MAINPAGE = docs/mainpage.md | |
| 986 | 988 | |
| 987 | 989 | #--------------------------------------------------------------------------- |
| 988 | 990 | # Configuration options related to source browsing | ... | ... |
docs/mainpage.md
| 1 | -# Introduction | |
| 1 | +# Introduction {#mainpage} | |
| 2 | 2 | |
| 3 | -This is the Doxygen API documentation for CLI11 parser. There is a friendly introduction to CLI11 on the [Github page](https://github.com/CLIUtils/CLI11), and [a tutorial series](https://cliutils.github.io/CLI11/book). | |
| 3 | +This is the Doxygen API documentation for CLI11 parser. There is a friendly introduction to CLI11 on the [Github page](https://github.com/CLIUtils/CLI11), and [a tutorial series](https://cliutils.github.io/CLI11/book/). | |
| 4 | 4 | |
| 5 | 5 | The main classes are: |
| 6 | 6 | ... | ... |