From 15e8508f8a7e039b6619dd571f58e4ff9811666a Mon Sep 17 00:00:00 2001
From: Joris Vaillant <joris.vaillant@inria.fr>
Date: Thu, 21 Nov 2024 15:45:48 +0100
Subject: [PATCH] octomap: Fix binding build when octomap is missing

cmake: Fix comment
---
 doc/CMakeLists.txt | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 6e0629b2..4f6a9a76 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -4,5 +4,16 @@ SET(DOXYGEN_GENERATE_XML        "YES"              PARENT_SCOPE)
 SET(DOXYGEN_EXPAND_ONLY_PREDEF  "NO"               PARENT_SCOPE)
 SET(DOXYGEN_ENABLE_PREPROCESSING "YES" PARENT_SCOPE)
 SET(DOXYGEN_MACRO_EXPANSION      "YES" PARENT_SCOPE)
+SET(DOXYGEN_EXCLUDE "${PROJECT_SOURCE_DIR}/include/hpp/")
+
+# We must not document octree if Octomap is not setup.
+# This create a build issue when building the bindings because doxygen-autodoc will
+# include octree.h that will include octomap.h.
+IF(NOT COAL_HAS_OCTOMAP)
+  SET(DOXYGEN_EXCLUDE "${DOXYGEN_EXCLUDE} ${PROJECT_SOURCE_DIR}/include/coal/octree.h")
+  SET(DOXYGEN_EXCLUDE "${DOXYGEN_EXCLUDE} ${PROJECT_SOURCE_DIR}/include/coal/serialization/octree.h")
+  SET(DOXYGEN_EXCLUDE "${DOXYGEN_EXCLUDE} ${PROJECT_SOURCE_DIR}/include/coal/internal/traversal_node_octree.h")
+ENDIF()
+SET(DOXYGEN_EXCLUDE ${DOXYGEN_EXCLUDE} PARENT_SCOPE)
 
 SET(DOXYGEN_PREDEFINED          "IS_DOXYGEN"       PARENT_SCOPE)
-- 
GitLab