feat(CTemplate): add Doxygen

This commit is contained in:
Jiří Štefka 2023-12-10 04:14:43 +01:00
parent 118f3632a9
commit 597ef1259d
Signed by: jiriks74
GPG key ID: 1D5E30D3DB2264DE
4 changed files with 2851 additions and 6 deletions

View file

@ -5,6 +5,8 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Turn on testing by default
option(BUILD_TESTING "Build tests" ON)
# Turn off documentation build by default
option(BUILD_DOC "Build documentation" OFF)
# Turn off coverage by default
option(ENABLE_COVERAGE "Enable test coverage" ON)
@ -24,12 +26,6 @@ FUNCTION(PREPEND var )
SET(${var} "${listVar}" PARENT_SCOPE)
ENDFUNCTION(PREPEND)
# After a normal build, we can specify the location of various outputs of the
# build. We put executables and static libraries outside the build directory in
# bin/ and lib/, respectively.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/lib")
# Include source code and headers. This calls the CMakeLists.txt in each
# subdirectory. These can define their own libraries, executables, etc. as targets,
# but here we define all exportable targets in the root CMakeLists.txt.
@ -50,3 +46,6 @@ endif()
add_executable(${PROJECT_NAME} ${SRC} ${INC})
target_include_directories(${PROJECT_NAME} PRIVATE include)
if(BUILD_DOC)
add_subdirectory(docs)
endif()

View file

@ -0,0 +1,20 @@
# check if Doxygen is installed
find_package(Doxygen)
if (DOXYGEN_FOUND)
# set input and output files
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
# request to configure the file
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
message("Doxygen build started")
# note the option ALL which allows to build the docs together with the application
add_custom_target(doc ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating documentation with Doxygen"
VERBATIM )
else (DOXYGEN_FOUND)
message("Doxygen needs to be installed to generate the documentation")
endif (DOXYGEN_FOUND)

2826
C_Tempate/docs/Doxyfile Normal file

File diff suppressed because it is too large Load diff

BIN
C_Tempate/docs/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB