From 2e68d0faf274d534055a62954817d53d8925468b Mon Sep 17 00:00:00 2001 From: fpagliughi Date: Sat, 13 Jul 2024 08:42:43 -0400 Subject: [PATCH] #503 Fixed documentation generation. --- doc/CMakeLists.txt | 36 ++++++++++++++++++++---------------- doc/Doxyfile.cmake | 4 ++-- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 01c1e97b..5327f689 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -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 @@ -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 +) diff --git a/doc/Doxyfile.cmake b/doc/Doxyfile.cmake index 41532af4..e861ee81 100644 --- a/doc/Doxyfile.cmake +++ b/doc/Doxyfile.cmake @@ -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