aboutsummaryrefslogtreecommitdiffstats
path: root/host/docs/CMakeLists.txt
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2014-04-09 17:19:28 +0200
committerMartin Braun <martin.braun@ettus.com>2014-04-09 17:25:09 +0200
commita6a119d353db18f38787d6cc3cb4a8e55faf8a0f (patch)
tree4a9c265ba40ec43a2df0314e3af5c70b600a74c1 /host/docs/CMakeLists.txt
parentc23fc7f5a66c80c1a0f7c78127bcfa5feb767261 (diff)
downloaduhd-a6a119d353db18f38787d6cc3cb4a8e55faf8a0f.tar.gz
uhd-a6a119d353db18f38787d6cc3cb4a8e55faf8a0f.tar.bz2
uhd-a6a119d353db18f38787d6cc3cb4a8e55faf8a0f.zip
docs: Adjusted CMake so Doxygen builds either manual, API docs, or both
Diffstat (limited to 'host/docs/CMakeLists.txt')
-rw-r--r--host/docs/CMakeLists.txt46
1 files changed, 35 insertions, 11 deletions
diff --git a/host/docs/CMakeLists.txt b/host/docs/CMakeLists.txt
index 015fa9dbb..cd061975b 100644
--- a/host/docs/CMakeLists.txt
+++ b/host/docs/CMakeLists.txt
@@ -20,31 +20,55 @@
########################################################################
########################################################################
-# Setup Manual
+# Setup general Doxygen variables
########################################################################
-MESSAGE(STATUS "")
FIND_PACKAGE(Doxygen)
+SET(ENABLE_MANUAL_OR_DOXYGEN false)
+
+########################################################################
+# Setup Manual (using Doxygen)
+########################################################################
+MESSAGE(STATUS "")
LIBUHD_REGISTER_COMPONENT("Manual" ENABLE_MANUAL ON "DOXYGEN_FOUND" OFF)
-# TODO conditionally add the manual to Doxygen, now it just adds dependencies
IF(ENABLE_MANUAL)
+ SET(ENABLE_MANUAL_OR_DOXYGEN true)
FILE(GLOB manual_sources "*.dox")
-ELSE(ENABLE_MANUAL)
- SET(manual_source "")
+ SET(DOXYGEN_DEPENDENCIES ${manual_sources})
+ SET(DOXYGEN_INPUT_DIRS ${CMAKE_SOURCE_DIR}/docs)
+ SET(DOXYGEN_DEP_COMPONENT "manual")
ENDIF(ENABLE_MANUAL)
-
########################################################################
-# Setup Doxygen
+# Setup API documentation (using Doxygen)
########################################################################
MESSAGE(STATUS "")
-LIBUHD_REGISTER_COMPONENT("Doxygen" ENABLE_DOXYGEN ON "DOXYGEN_FOUND" OFF)
+LIBUHD_REGISTER_COMPONENT("API/Doxygen" ENABLE_DOXYGEN ON "DOXYGEN_FOUND" OFF)
+OPTION(ENABLE_DOXYGEN_FULL "Use Doxygen to document the entire source tree (not just API)" OFF)
IF(LIBUHDDEV_PKG)
SET(PKG_DOC_DIR share/doc/libuhd-dev)
ENDIF(LIBUHDDEV_PKG)
IF(ENABLE_DOXYGEN)
+ SET(ENABLE_MANUAL_OR_DOXYGEN true)
+ #make doxygen directory depend on the header files
+ FILE(GLOB_RECURSE header_files ${CMAKE_SOURCE_DIR}/include/*.hpp)
+ SET(DOXYGEN_DEPENDENCIES ${DOXYGEN_DEPENDENCIES} ${header_files})
+ IF(ENABLE_DOXYGEN_FULL)
+ SET(DOXYGEN_INPUT_DIRS "${DOXYGEN_INPUT_DIRS} ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/lib")
+ ELSE(ENABLE_DOXYGEN_FULL)
+ SET(DOXYGEN_INPUT_DIRS "${DOXYGEN_INPUT_DIRS} ${CMAKE_SOURCE_DIR}/include")
+ ENDIF(ENABLE_DOXYGEN_FULL)
+
+ SET(DOXYGEN_DEP_COMPONENT "doxygen")
+ENDIF(ENABLE_DOXYGEN)
+
+########################################################################
+# Run Doxygen (on code and/or manual, depending on CMake flags)
+########################################################################
+MESSAGE(STATUS "")
+IF(ENABLE_MANUAL_OR_DOXYGEN)
#generate the doxygen configuration file
SET(CMAKE_CURRENT_BINARY_DIR_DOXYGEN ${CMAKE_CURRENT_BINARY_DIR}/doxygen)
CONFIGURE_FILE(
@@ -55,15 +79,15 @@ IF(ENABLE_DOXYGEN)
#make doxygen directory depend on the header files
FILE(GLOB_RECURSE header_files ${CMAKE_SOURCE_DIR}/include/*.hpp)
ADD_CUSTOM_COMMAND(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR_DOXYGEN} DEPENDS ${header_files} ${manual_source}
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR_DOXYGEN} DEPENDS ${DOXYGEN_DEPENDENCIES}
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
COMMENT "Generating documentation with doxygen"
)
#make the doxygen generation a built-time dependency
ADD_CUSTOM_TARGET(doxygen_docs ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR_DOXYGEN})
- UHD_INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR_DOXYGEN} DESTINATION ${PKG_DOC_DIR} COMPONENT doxygen)
-ENDIF(ENABLE_DOXYGEN)
+ UHD_INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR_DOXYGEN} DESTINATION ${PKG_DOC_DIR} COMPONENT ${DOXYGEN_DEP_COMPONENT})
+ENDIF(ENABLE_MANUAL_OR_DOXYGEN)
########################################################################
# List of man page sources