From: "A. Maitland Bottoms" <bottoms@debian.org>
Date: Sun, 31 Aug 2025 23:45:04 -0400
Subject: [PATCH] build without doxygen
Forwarded: not-needed

--- a/host/docs/CMakeLists.txt
+++ b/host/docs/CMakeLists.txt
@@ -7,13 +7,101 @@
 #
 
 ########################################################################
-# List of manual sources
+# List of man page sources
 ########################################################################
 
+set(man_page_sources
+    uhd_adc_self_cal.1
+    uhd_cal_rx_iq_balance.1
+    uhd_cal_tx_dc_offset.1
+    uhd_cal_tx_iq_balance.1
+    uhd_config_info.1
+    uhd_find_devices.1
+    uhd_image_loader.1
+    uhd_images_downloader.1
+    uhd_usrp_probe.1
+    usrp2_card_burner.1
+    rfnoc_modtool.1
+    rfnoc_image_builder.1
+)
+
+if (ENABLE_PYTHON_API)
+    list(APPEND man_page_sources
+        usrpctl.1
+    )
+endif(ENABLE_PYTHON_API)
+
+########################################################################
+# Setup man pages
+########################################################################
+# No elegant way in CMake to reverse a boolean
+if(NOT WIN32)
+    set(NOT_WIN32 TRUE)
+endif(NOT WIN32)
+
+set(MAN_PAGES_DEPS "NOT_WIN32")
+
+# Quietly see if we have GZip, if not, we can skip trying to compress
+# the man pages
+find_package(GZip QUIET)
+set(ENABLE_MAN_PAGE_COMPRESSION ${GZIP_FOUND} CACHE BOOL "Compress Man Pages")
+
+message(STATUS "")
+if(ENABLE_MAN_PAGE_COMPRESSION)
+    # If gzip is not found, this will force failure in
+    # LIBUHD_REGISTER_COMPONENT for ENABLE_MAN_PAGES
+    list(APPEND MAN_PAGES_DEPS "GZIP_FOUND")
+    if(GZIP_FOUND)
+        message(STATUS "Found GZip: ${GZIP_EXECUTABLE}")
+        message(STATUS "")
+        message(STATUS "Compressed Man Pages enabled")
+    else()
+        message(FATAL_ERROR
+                "ENABLE_MAN_PAGE_COMPRESSION is set, "
+                "but GZip compression program not found!")
+        message(STATUS "")
+    endif()
+else()
+    message(STATUS "Compressed Man Pages disabled")
+endif(ENABLE_MAN_PAGE_COMPRESSION)
+message(STATUS "  Override with -DENABLE_MAN_PAGE_COMPRESSION=ON/OFF")
+
+LIBUHD_REGISTER_COMPONENT("Man Pages" ENABLE_MAN_PAGES ON "${MAN_PAGES_DEPS}" OFF OFF)
+if(ENABLE_MAN_PAGES)
+    #Generate man pages; either compressed or not
+    if(ENABLE_MAN_PAGE_COMPRESSION)
+        # compress man pages
+        foreach(manfile ${man_page_sources})
+            #make the gzip file depend on the text file
+            string(REPLACE ".1" "" PROGRAM_NAME "${manfile}")
+            set(gzfile "${CMAKE_CURRENT_BINARY_DIR}/${manfile}.gz")
+            set(manfile "${CMAKE_CURRENT_SOURCE_DIR}/${manfile}")
+            add_custom_command(
+                OUTPUT ${gzfile}
+                DEPENDS ${manfile}
+                COMMAND ${GZIP_EXECUTABLE} -9 -cf ${manfile} > ${gzfile}
+                COMMENT "Generating ${PROGRAM_NAME} man page"
+            )
+            #make the man page target depend on the gz file
+            list(APPEND man_page_gz_files ${gzfile})
+        endforeach(manfile ${man_page_sources})
+        #make the man pages a build-time dependency
+        UHD_INSTALL(FILES ${man_page_gz_files} DESTINATION ${PKG_MAN_DIR} COMPONENT manpages)
+        add_custom_target(man_page_gzips ALL DEPENDS ${man_page_gz_files})
+    else(ENABLE_MAN_PAGE_COMPRESSION)
+        # uncompressed man pages; just install them
+        UHD_INSTALL(FILES ${man_page_sources} DESTINATION ${PKG_MAN_DIR} COMPONENT manpages)
+    endif(ENABLE_MAN_PAGE_COMPRESSION)
+endif(ENABLE_MAN_PAGES)
+
 ########################################################################
 # Setup general Doxygen variables
 ########################################################################
 find_package(Doxygen)
+if (NOT Doxygen_FOUND)
+  message(STATUS "Doxygen not found - skipping API/Doxygen and Manual components.")
+  return()
+endif()
 set(ENABLE_MANUAL_OR_DOXYGEN false)
 
 ########################################################################
@@ -129,91 +217,3 @@
    #  DESTINATION ${CMAKE_INSTALL_DOCDIR})
  endif()
 endif()
-
-########################################################################
-# List of man page sources
-########################################################################
-
-set(man_page_sources
-    uhd_adc_self_cal.1
-    uhd_cal_rx_iq_balance.1
-    uhd_cal_tx_dc_offset.1
-    uhd_cal_tx_iq_balance.1
-    uhd_config_info.1
-    uhd_find_devices.1
-    uhd_image_loader.1
-    uhd_images_downloader.1
-    uhd_usrp_probe.1
-    usrp2_card_burner.1
-    rfnoc_modtool.1
-    rfnoc_image_builder.1
-)
-
-if (ENABLE_PYTHON_API)
-    list(APPEND man_page_sources
-        usrpctl.1
-    )
-endif(ENABLE_PYTHON_API)
-
-########################################################################
-# Setup man pages
-########################################################################
-# No elegant way in CMake to reverse a boolean
-if(NOT WIN32)
-    set(NOT_WIN32 TRUE)
-endif(NOT WIN32)
-
-set(MAN_PAGES_DEPS "NOT_WIN32")
-
-# Quietly see if we have GZip, if not, we can skip trying to compress
-# the man pages
-find_package(GZip QUIET)
-set(ENABLE_MAN_PAGE_COMPRESSION ${GZIP_FOUND} CACHE BOOL "Compress Man Pages")
-
-message(STATUS "")
-if(ENABLE_MAN_PAGE_COMPRESSION)
-    # If gzip is not found, this will force failure in
-    # LIBUHD_REGISTER_COMPONENT for ENABLE_MAN_PAGES
-    list(APPEND MAN_PAGES_DEPS "GZIP_FOUND")
-    if(GZIP_FOUND)
-        message(STATUS "Found GZip: ${GZIP_EXECUTABLE}")
-        message(STATUS "")
-        message(STATUS "Compressed Man Pages enabled")
-    else()
-        message(FATAL_ERROR
-                "ENABLE_MAN_PAGE_COMPRESSION is set, "
-                "but GZip compression program not found!")
-        message(STATUS "")
-    endif()
-else()
-    message(STATUS "Compressed Man Pages disabled")
-endif(ENABLE_MAN_PAGE_COMPRESSION)
-message(STATUS "  Override with -DENABLE_MAN_PAGE_COMPRESSION=ON/OFF")
-
-LIBUHD_REGISTER_COMPONENT("Man Pages" ENABLE_MAN_PAGES ON "${MAN_PAGES_DEPS}" OFF OFF)
-if(ENABLE_MAN_PAGES)
-    #Generate man pages; either compressed or not
-    if(ENABLE_MAN_PAGE_COMPRESSION)
-        # compress man pages
-        foreach(manfile ${man_page_sources})
-            #make the gzip file depend on the text file
-            string(REPLACE ".1" "" PROGRAM_NAME "${manfile}")
-            set(gzfile "${CMAKE_CURRENT_BINARY_DIR}/${manfile}.gz")
-            set(manfile "${CMAKE_CURRENT_SOURCE_DIR}/${manfile}")
-            add_custom_command(
-                OUTPUT ${gzfile}
-                DEPENDS ${manfile}
-                COMMAND ${GZIP_EXECUTABLE} -9 -cf ${manfile} > ${gzfile}
-                COMMENT "Generating ${PROGRAM_NAME} man page"
-            )
-            #make the man page target depend on the gz file
-            list(APPEND man_page_gz_files ${gzfile})
-        endforeach(manfile ${man_page_sources})
-        #make the man pages a build-time dependency
-        UHD_INSTALL(FILES ${man_page_gz_files} DESTINATION ${PKG_MAN_DIR} COMPONENT manpages)
-        add_custom_target(man_page_gzips ALL DEPENDS ${man_page_gz_files})
-    else(ENABLE_MAN_PAGE_COMPRESSION)
-        # uncompressed man pages; just install them
-        UHD_INSTALL(FILES ${man_page_sources} DESTINATION ${PKG_MAN_DIR} COMPONENT manpages)
-    endif(ENABLE_MAN_PAGE_COMPRESSION)
-endif(ENABLE_MAN_PAGES)
