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

pass CMake variables to Doxygen

This commit is contained in:
B Krishna Chaitanya 2020-07-27 15:42:04 +05:30
parent ef03aab73e
commit 919a07044a
3 changed files with 23 additions and 19 deletions

View file

@ -18,9 +18,7 @@ CPMAddPackage(
DOWNLOAD_ONLY YES
)
# ---- Doxygen ----
find_package(Doxygen)
# ---- Doxygen + m.css ----
# set Doxyfile variables
set(DOXYGEN_PROJECT_NAME Greeter)
@ -28,11 +26,15 @@ set(DOXYGEN_PROJECT_VERSION ${Greeter_VERSION})
set(DOXYGEN_PROJECT_ROOT "${CMAKE_CURRENT_LIST_DIR}/..")
set(DOXYGEN_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doxygen")
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)
configure_file(
${CMAKE_CURRENT_LIST_DIR}/Doxyfile
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
)
add_custom_target(
GenerateDocs
${CMAKE_COMMAND} -E make_directory "${DOXYGEN_OUTPUT_DIRECTORY}"
COMMAND "${MCSS_SOURCE_DIR}/documentation/doxygen.py" "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile"
COMMAND echo "Docs written to: ${DOXYGEN_OUTPUT_DIRECTORY}"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)

View file

@ -3,10 +3,11 @@
# To create a new Doxyfile containing all available options, call `doxygen -g`
# Get Project name and version from CMake
PROJECT_NAME = Greeter
PROJECT_NAME = @DOXYGEN_PROJECT_NAME@
PROJECT_NUMBER = @DOXYGEN_PROJECT_VERSION@
# Add sources
INPUT = ../README.md ../include ../source
INPUT = @DOXYGEN_PROJECT_ROOT@/README.md @DOXYGEN_PROJECT_ROOT@/include @DOXYGEN_PROJECT_ROOT@/source
EXTRACT_ALL = YES
RECURSIVE = YES
@ -14,7 +15,7 @@ RECURSIVE = YES
FULL_PATH_NAMES = NO
# Use the README as a main page
USE_MDFILE_AS_MAINPAGE = ../README.md
USE_MDFILE_AS_MAINPAGE = @DOXYGEN_PROJECT_ROOT@/README.md
# Create nicer looking HTML
HTML_DYNAMIC_SECTIONS = YES
@ -22,3 +23,9 @@ GENERATE_TREEVIEW = YES
# We don't need LaTeX generation
GENERATE_LATEX = NO
# Setup m.css
GENERATE_HTML = NO
GENERATE_XML = YES
XML_PROGRAMLISTING = NO
OUTPUT_DIRECTORY = @DOXYGEN_OUTPUT_DIRECTORY@

View file

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