Skip to content

Commit

Permalink
fix the warnings complained by Doxygen and removed Sphinx's way
Browse files Browse the repository at this point in the history
  • Loading branch information
quickssl committed Mar 5, 2024
1 parent e5ba89a commit 62ef30c
Show file tree
Hide file tree
Showing 14 changed files with 390 additions and 610 deletions.
68 changes: 21 additions & 47 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,54 +1,28 @@
find_package(Doxygen REQUIRED)
find_package(Sphinx REQUIRED)
find_package(Doxygen)

# Find all the public headers
get_target_property(HSMC_PUBLIC_HEADER_DIR hsmc INTERFACE_INCLUDE_DIRECTORIES)
file(GLOB_RECURSE HSMC_PUBLIC_HEADERS ../include/hsmc/*.h)
if (DOXYGEN_FOUND)
set(DOXYGEN_INPUT_DIR "${DOXYGEN_INPUT_DIR} ${PROJECT_SOURCE_DIR}/include")
set(DOXYGEN_INPUT_DIR "${DOXYGEN_INPUT_DIR} ${PROJECT_SOURCE_DIR}/src")
set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/doxygen)
set(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
set(DOXYFILE_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)

set(DOXYGEN_INPUT_DIR "${DOXYGEN_INPUT_DIR} ${PROJECT_SOURCE_DIR}/include")
set(DOXYGEN_INPUT_DIR "${DOXYGEN_INPUT_DIR} ${PROJECT_SOURCE_DIR}/src")
set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/doxygen)
set(DOXYGEN_INDEX_FILE ${DOXYGEN_OUTPUT_DIR}/xml/index.xml)
set(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
set(DOXYFILE_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
#Replace variables inside @@ with the current values
configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY)

#Replace variables inside @@ with the current values
configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY)
add_custom_target(Doxygen ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM)

file(MAKE_DIRECTORY ${DOXYGEN_OUTPUT_DIR}) #Doxygen won't create this for us
add_custom_command(OUTPUT ${DOXYGEN_INDEX_FILE}
DEPENDS ${HSMC_PUBLIC_HEADERS}
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT}
MAIN_DEPENDENCY ${DOXYFILE_OUT} ${DOXYFILE_IN}
COMMENT "Generating docs")
# Add an install target to install the docs
include(GNUInstallDirs)
install(DIRECTORY ${DOXYGEN_OUTPUT_DIR}
DESTINATION ${CMAKE_INSTALL_DOCDIR})

add_custom_target(Doxygen ALL DEPENDS ${DOXYGEN_INDEX_FILE})
else (DOXYGEN_FOUND)
message(WARNING "Doxygen need to be installed to generate the documentation")
endif(DOXYGEN_FOUND)

set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR})
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/sphinx)
set(SPHINX_INDEX_FILE ${SPHINX_BUILD}/index.html)

# Only regenerate Sphinx when:
# - Doxygen has rerun
# - Our doc files have been updated
# - The Sphinx config has been updated
add_custom_command(OUTPUT ${SPHINX_INDEX_FILE}
COMMAND ${SPHINX_EXECUTABLE} -b html
# Tell Breathe where to find the Doxygen output
-Dbreathe_projects.hsmc=${DOXYGEN_OUTPUT_DIR}/xml
${SPHINX_SOURCE} ${SPHINX_BUILD}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS
# Other docs files you want to track should go here (or in some variable)
${CMAKE_CURRENT_SOURCE_DIR}/*.rst
${DOXYGEN_INDEX_FILE}
MAIN_DEPENDENCY ${SPHINX_SOURCE}/conf.py
COMMENT "Generating documentation with Sphinx")

# Nice named target so we can run the job easily
add_custom_target(Sphinx ALL DEPENDS ${SPHINX_INDEX_FILE})

# Add an install target to install the docs
include(GNUInstallDirs)
install(DIRECTORY ${SPHINX_BUILD}
DESTINATION ${CMAKE_INSTALL_DOCDIR})
10 changes: 5 additions & 5 deletions docs/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.

PROJECT_NAME = "HSMC API"
PROJECT_NAME = "HSMConn"

# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
Expand All @@ -54,7 +54,7 @@ PROJECT_NUMBER =
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.

PROJECT_BRIEF = "HSMC API参考"
PROJECT_BRIEF = "HSMConn API 参考文档"

# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
# in the documentation. The maximum height of the logo should not exceed 55
Expand Down Expand Up @@ -852,7 +852,7 @@ WARNINGS = YES
# will automatically be disabled.
# The default value is: YES.

WARN_IF_UNDOCUMENTED = YES
WARN_IF_UNDOCUMENTED = NO

# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
# potential errors in the documentation, such as documenting some parameters in
Expand Down Expand Up @@ -1879,7 +1879,7 @@ EXTRA_SEARCH_MAPPINGS =
# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
# The default value is: YES.

GENERATE_LATEX = YES
GENERATE_LATEX = NO

# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
Expand Down Expand Up @@ -2163,7 +2163,7 @@ MAN_LINKS = NO
# captures the structure of the code including all documentation.
# The default value is: NO.

GENERATE_XML = YES
GENERATE_XML = NO

# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
Expand Down
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

60 changes: 0 additions & 60 deletions docs/api.rst

This file was deleted.

50 changes: 0 additions & 50 deletions docs/conf.py

This file was deleted.

20 changes: 0 additions & 20 deletions docs/index.rst

This file was deleted.

22 changes: 0 additions & 22 deletions docs/intro.rst

This file was deleted.

35 changes: 0 additions & 35 deletions docs/make.bat

This file was deleted.

27 changes: 0 additions & 27 deletions docs/vendors.rst

This file was deleted.

Loading

0 comments on commit 62ef30c

Please sign in to comment.