Skip to content

Commit

Permalink
#503 Fixed documentation generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
fpagliughi committed Jul 13, 2024
1 parent 02b589e commit 2e68d0f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
36 changes: 20 additions & 16 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#*******************************************************************************
# Copyright (c) 2016
# Copyright (c) 2024, Frank Pagliughi
# Copyright (c) 2016, Guilherme Maciel Ferreira
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
Expand All @@ -11,33 +12,36 @@
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# Contributors:
# Frank Pagliughi - Updated paths. Fixed conflict with Paho C
# Guilherme Maciel Ferreira - initial version
#*******************************************************************************/

## documentation settings
find_package(Doxygen)
if(NOT DOXYGEN_FOUND)
message(FATAL_ERROR "Doxygen is needed to build the documentation.")
endif()

set(DOXYTARGETS)

find_package(Doxygen REQUIRED)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc)

set(DOXYFILE_SRC Doxyfile.cmake)
set(DOXYFILE ${CMAKE_CURRENT_BINARY_DIR}/${DOXYFILE_SRC})
message(STATUS "Doxygen: ${DOXYGEN_EXECUTABLE}")

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.cmake
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
@ONLY
)

configure_file(${DOXYFILE_SRC} ${DOXYFILE} @ONLY)
add_custom_target(
${DOXYFILE_SRC}.target
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE}
paho-mqttpp3-doc.target
COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM
)
set(DOXYTARGETS ${DOXYTARGETS} ${DOXYFILE_SRC}.target)

add_custom_target(doc ALL DEPENDS ${DOXYTARGETS})
add_custom_target(paho-mqttpp3-doc ALL
DEPENDS paho-mqttpp3-doc.target
)

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc DESTINATION share)
install(
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/
DESTINATION share/doc/EclipsePahoCpp
)

4 changes: 2 additions & 2 deletions doc/Doxyfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -648,8 +648,8 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.

STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@/src/mqtt
INPUT = @PROJECT_SOURCE_DIR@/src/mqtt/
STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@/include/mqtt
INPUT = @PROJECT_SOURCE_DIR@/include/mqtt/

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
Expand Down

0 comments on commit 2e68d0f

Please sign in to comment.