From e13ad95a785cb92794d303db98168bc24762b0fd Mon Sep 17 00:00:00 2001 From: Siddharth Chandrasekaran Date: Sat, 23 Mar 2024 04:19:21 +0100 Subject: [PATCH] doc: Fix doxygen build by copying and patching osdp.h Signed-off-by: Siddharth Chandrasekaran --- doc/CMakeLists.txt | 13 ++++++++++++- doc/api/control-panel.rst | 1 + doc/osdpctl/introduction.rst | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 89481b92..9091d345 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -7,7 +7,18 @@ if(SPHINX_FOUND AND DOXYGEN_FOUND) get_target_property(LIBOSDP_PUBLIC_HEADER_DIR osdp INTERFACE_INCLUDE_DIRECTORIES) file(GLOB_RECURSE LIBOSDP_PUBLIC_HEADERS ${LIBOSDP_PUBLIC_HEADER_DIR}/*.h) -set(DOXYGEN_INPUT_DIRS "${CMAKE_SOURCE_DIR}/include/osdp.h ${CMAKE_SOURCE_DIR}/src") +# Copy public header and patch it for doxygen run +configure_file( + ${PROJECT_SOURCE_DIR}/include/osdp.h + ${CMAKE_CURRENT_BINARY_DIR}/include/osdp.h + COPYONLY +) +execute_process( + COMMAND sed -ie "/^#include $/d" ${CMAKE_CURRENT_BINARY_DIR}/include/osdp.h + COMMAND sed -ie "/^OSDP_EXPORT$/d" ${CMAKE_CURRENT_BINARY_DIR}/include/osdp.h +) + +set(DOXYGEN_INPUT_DIRS ${CMAKE_CURRENT_BINARY_DIR}/include/) set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/doxygen) set(DOXYGEN_INDEX_FILE ${DOXYGEN_OUTPUT_DIR}/html/index.html) diff --git a/doc/api/control-panel.rst b/doc/api/control-panel.rst index bea8f84e..3ed8d8b3 100644 --- a/doc/api/control-panel.rst +++ b/doc/api/control-panel.rst @@ -69,3 +69,4 @@ Others .. doxygenfunction:: osdp_cp_get_pd_id .. doxygenfunction:: osdp_cp_modify_flag + diff --git a/doc/osdpctl/introduction.rst b/doc/osdpctl/introduction.rst index 58fff519..6f4e12a8 100644 --- a/doc/osdpctl/introduction.rst +++ b/doc/osdpctl/introduction.rst @@ -48,7 +48,7 @@ used to start it. osdpctl pd-0.cfg stop Send control commands to an OSDP service ---------------------------------------- +---------------------------------------- A command to be sent to a running CP/PD service must be of the following format. Some of these commands will in-turn be sent by the CP/PD device to its connected