Commit c4085056382d242fdb1f9339c327c213572dbabd

Authored by Henry Schreiner
1 parent 4660788c

Fixes for doxygen generation

CMakeLists.txt
@@ -60,7 +60,7 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) @@ -60,7 +60,7 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
60 endif() 60 endif()
61 endif() 61 endif()
62 62
63 - if(CMAKE_VERSION VERSION_GREATER 3.6) 63 + if(NOT CMAKE_VERSION VERSION_LESS 3.6)
64 # Add clang-tidy if available 64 # Add clang-tidy if available
65 option(CLANG_TIDY_FIX "Perform fixes for Clang-Tidy" OFF) 65 option(CLANG_TIDY_FIX "Perform fixes for Clang-Tidy" OFF)
66 find_program( 66 find_program(
@@ -77,6 +77,17 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) @@ -77,6 +77,17 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
77 endif() 77 endif()
78 endif() 78 endif()
79 endif() 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 else() 91 else()
81 set(CUR_PROJ OFF) 92 set(CUR_PROJ OFF)
82 endif() 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 # Doxyfile 1.8.13 1 # Doxyfile 1.8.13
2 2
  3 +# Designed to be run from the main directory with `doxygen docs/Doxygen`
  4 +
3 # This file describes the settings to be used by the documentation system 5 # This file describes the settings to be used by the documentation system
4 # doxygen (www.doxygen.org) for a project. 6 # doxygen (www.doxygen.org) for a project.
5 # 7 #
@@ -790,7 +792,7 @@ WARN_LOGFILE = @@ -790,7 +792,7 @@ WARN_LOGFILE =
790 # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING 792 # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
791 # Note: If this tag is empty the current directory is searched. 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 # This tag can be used to specify the character encoding of the source files 797 # This tag can be used to specify the character encoding of the source files
796 # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses 798 # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -982,7 +984,7 @@ FILTER_SOURCE_PATTERNS = @@ -982,7 +984,7 @@ FILTER_SOURCE_PATTERNS =
982 # (index.html). This can be useful if you have a project on for instance GitHub 984 # (index.html). This can be useful if you have a project on for instance GitHub
983 # and want to reuse the introduction page also for the doxygen output. 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 # Configuration options related to source browsing 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 The main classes are: 5 The main classes are:
6 6