chore: build doxygen documentation

追加基于 doxygen 的文档构建

Log:
This commit is contained in:
Gary Wang 2022-07-04 10:52:39 +08:00 committed by deepin-bot[bot]
parent 7947860818
commit 86ae88ebe4
3 changed files with 55 additions and 1 deletions

16
CMakeLists.txt Normal file
View File

@ -0,0 +1,16 @@
cmake_minimum_required (VERSION 3.10)
project (DtkCore
VERSION "${DTK_REPO_MODULE_VERSION}"
DESCRIPTION "DTK Core module"
HOMEPAGE_URL ""
LANGUAGES CXX C
)
find_package (Qt5 CONFIG REQUIRED COMPONENTS DBus Xml)
set (BUILD_DOCS ON CACHE BOOL "Generate doxygen-based documentation")
if (BUILD_DOCS)
add_subdirectory(doc)
endif ()

2
debian/rules vendored
View File

@ -15,7 +15,7 @@ else
endif
%:
dh $@ --parallel
dh $@ --buildsystem=qmake --parallel
override_dh_auto_configure:
dh_auto_configure -- LIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) VERSION=$(CONFIG_VERSION)

38
doc/CMakeLists.txt Normal file
View File

@ -0,0 +1,38 @@
cmake_minimum_required (VERSION 3.10)
find_package (Doxygen REQUIRED)
set (QCH_INSTALL_DESTINATION ${CMAKE_INSTALLL_PREFIX}/share/DDE/dtk CACHE STRING "QCH install location")
set (DOXYGEN_GENERATE_HTML "NO" CACHE STRING "Doxygen HTML output")
set (DOXYGEN_GENERATE_XML "NO" CACHE STRING "Doxygen XML output")
set (DOXYGEN_GENERATE_QHP "YES" CACHE STRING "Doxygen QHP output")
set (DOXYGEN_FILE_PATTERNS *.cpp *.h *.md *.zh_CN.dox CACHE STRING "Doxygen File Patterns")
set (DOXYGEN_PROJECT_NUMBER ${CMAKE_PROJECT_VERSION} CACHE STRING "") # Should be the same as this project is using.
set (DOXYGEN_EXTRACT_STATIC YES)
set (DOXYGEN_OUTPUT_LANGUAGE "Chinese")
set (DOXYGEN_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/docs/)
set (DOXYGEN_QHG_LOCATION "qhelpgenerator")
set (DOXYGEN_QHP_NAMESPACE "org.deepin.dtk.core")
set (DOXYGEN_QCH_FILE "dtkcore.qch")
set (DOXYGEN_QHP_VIRTUAL_FOLDER "dtkcore")
set (DOXYGEN_HTML_EXTRA_STYLESHEET "" CACHE STRING "Doxygen custom stylesheet for HTML output")
set (DOXYGEN_TAGFILES "qtcore.tags=qthelp://org.qt-project.qtcore/qtcore/" CACHE STRING "Doxygen tag files")
set (DOXYGEN_PREDEFINED
"\"DCORE_BEGIN_NAMESPACE=namespace Dtk { namespace Core {\""
"\"DCORE_END_NAMESPACE=}}\""
"\"DCORE_USE_NAMESPACE=using Dtk::Core\""
)
set (DOXYGEN_MACRO_EXPANSION "YES")
set (DOXYGEN_EXPAND_ONLY_PREDEF "YES")
doxygen_add_docs (doxygen
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/doc
ALL
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Generate documentation via Doxygen"
)
install (FILES ${PROJECT_BINARY_DIR}/docs/html/dtkcore.qch DESTINATION ${QCH_INSTALL_DESTINATION})