diff options
author | Martin Braun <martin.braun@ettus.com> | 2014-04-09 17:19:28 +0200 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2014-04-09 17:25:09 +0200 |
commit | a6a119d353db18f38787d6cc3cb4a8e55faf8a0f (patch) | |
tree | 4a9c265ba40ec43a2df0314e3af5c70b600a74c1 /host/docs | |
parent | c23fc7f5a66c80c1a0f7c78127bcfa5feb767261 (diff) | |
download | uhd-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')
-rw-r--r-- | host/docs/CMakeLists.txt | 46 | ||||
-rw-r--r-- | host/docs/Doxyfile.in | 4 |
2 files changed, 37 insertions, 13 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 diff --git a/host/docs/Doxyfile.in b/host/docs/Doxyfile.in index 432e542aa..bf862c0c2 100644 --- a/host/docs/Doxyfile.in +++ b/host/docs/Doxyfile.in @@ -654,8 +654,8 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = @CMAKE_SOURCE_DIR@/include \ - @CMAKE_SOURCE_DIR@/docs +INPUT = @DOXYGEN_INPUT_DIRS@ + # 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 # also the default input encoding. Doxygen uses libiconv (or the iconv built |