1
0
Fork 0
mirror of https://github.com/TheLartians/ModernCppStarter.git synced 2025-08-30 21:51:12 +02:00

Use m.css for generating doxygen docs

This commit is contained in:
B Krishna Chaitanya 2020-07-23 16:58:55 +05:30
parent 2f1b5fab76
commit ef03aab73e
4 changed files with 28 additions and 19 deletions

View file

@ -12,25 +12,27 @@ CPMAddPackage(
)
CPMAddPackage(
NAME StableCoder-cmake-scripts
GITHUB_REPOSITORY StableCoder/cmake-scripts
GIT_TAG 3d2d5a9fb26f0ce24e3e4eaeeff686ec2ecfb3fb
NAME MCSS
GITHUB_REPOSITORY mosra/m.css
GIT_TAG e6eff549fb5edeabacf01369d6b845a2a59c2ebe
DOWNLOAD_ONLY YES
)
# ---- Doxygen ----
set(BUILD_DOCUMENTATION ON CACHE INTERNAL "")
include(${StableCoder-cmake-scripts_SOURCE_DIR}/doxygen.cmake)
find_package(Doxygen)
# set Doxyfile variables
set(DOXYGEN_PROJECT_NAME Greeter)
set(DOXYGEN_PROJECT_VERSION ${Greeter_VERSION})
set(DOXYGEN_PROJECT_ROOT "${CMAKE_CURRENT_LIST_DIR}/..")
set(DOXYGEN_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doxygen")
# see https://github.com/StableCoder/cmake-scripts#doxygen-doxygencmake for additional options
build_docs(
TARGET_NAME GenerateDocs
DOXYFILE_PATH ${CMAKE_CURRENT_LIST_DIR}/Doxyfile
OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/doxygen
PROCESS_DOXYFILE ON
)
if (DOXYGEN_FOUND)
add_custom_target(
GenerateDocs
${CMAKE_COMMAND} -E make_directory "${DOXYGEN_OUTPUT_DIRECTORY}"
COMMAND "${MCSS_SOURCE_DIR}/documentation/doxygen.py" "${CMAKE_CURRENT_LIST_DIR}/Doxyfile-mcss"
COMMAND echo "Docs written to: ${DOXYGEN_OUTPUT_DIRECTORY}"
)
endif(DOXYGEN_FOUND)

View file

@ -3,11 +3,10 @@
# To create a new Doxyfile containing all available options, call `doxygen -g`
# Get Project name and version from CMake
PROJECT_NAME = @DOXYGEN_PROJECT_NAME@
PROJECT_NUMBER = @DOXYGEN_PROJECT_VERSION@
PROJECT_NAME = Greeter
# Add sources
INPUT = @DOXYGEN_PROJECT_ROOT@/README.md @DOXYGEN_PROJECT_ROOT@/include @DOXYGEN_PROJECT_ROOT@/source
INPUT = ../README.md ../include ../source
EXTRACT_ALL = YES
RECURSIVE = YES
@ -15,7 +14,7 @@ RECURSIVE = YES
FULL_PATH_NAMES = NO
# Use the README as a main page
USE_MDFILE_AS_MAINPAGE = @DOXYGEN_PROJECT_ROOT@/README.md
USE_MDFILE_AS_MAINPAGE = ../README.md
# Create nicer looking HTML
HTML_DYNAMIC_SECTIONS = YES

View file

@ -0,0 +1,5 @@
@INCLUDE = Doxyfile
GENERATE_HTML = NO
GENERATE_XML = YES
XML_PROGRAMLISTING = NO
OUTPUT_DIRECTORY = ../build/doc/doxygen

View file

@ -2,26 +2,29 @@
#include <string>
/**
* @brief The greeter namespace
*/
namespace greeter {
/** Language codes to be used with the Greeter class */
enum class LanguageCode { EN, DE, ES, FR };
/**
* A class for saying hello in multiple languages
* @brief A class for saying hello in multiple languages
*/
class Greeter {
std::string name;
public:
/**
* Creates a new greeter
* @brief Creates a new greeter
* @param name the name to greet
*/
Greeter(std::string name);
/**
* Creates a localized string containing the greeting
* @brief Creates a localized string containing the greeting
* @param lang the language to greet in
* @return a string containing the greeting
*/