Added cmake script for generating doxygen in more detail, can now generate documentation for all of gtsam and gtsam_unstable
parent
c9c43e1cf5
commit
ce65f2e925
|
@ -36,9 +36,6 @@ else()
|
||||||
set(GTSAM_UNSTABLE_AVAILABLE 0)
|
set(GTSAM_UNSTABLE_AVAILABLE 0)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Check for doxygen availability
|
|
||||||
find_package(Doxygen)
|
|
||||||
|
|
||||||
# Configurable Options
|
# Configurable Options
|
||||||
option(GTSAM_BUILD_TESTS "Enable/Disable building of tests" ON)
|
option(GTSAM_BUILD_TESTS "Enable/Disable building of tests" ON)
|
||||||
option(GTSAM_BUILD_TIMING "Enable/Disable building of timing scripts" ON)
|
option(GTSAM_BUILD_TIMING "Enable/Disable building of timing scripts" ON)
|
||||||
|
@ -156,49 +153,13 @@ endif(GTSAM_BUILD_UNSTABLE)
|
||||||
GtsamMakeConfigFile(GTSAM)
|
GtsamMakeConfigFile(GTSAM)
|
||||||
export(TARGETS ${GTSAM_EXPORTED_TARGETS} FILE GTSAM-exports.cmake)
|
export(TARGETS ${GTSAM_EXPORTED_TARGETS} FILE GTSAM-exports.cmake)
|
||||||
|
|
||||||
# Doxygen documentation configuration
|
# Check for doxygen availability - optional dependency
|
||||||
|
find_package(Doxygen)
|
||||||
|
|
||||||
|
# Doxygen documentation - enabling options in subfolder
|
||||||
if (DOXYGEN_FOUND)
|
if (DOXYGEN_FOUND)
|
||||||
option(GTSAM_BUILD_DOCS "Enable/Disable building of doxygen docs" ON)
|
add_subdirectory(doc)
|
||||||
|
endif()
|
||||||
# configure doxygen
|
|
||||||
option(GTSAM_BUILD_DOC_HTML "Enable/Disable doxygen HTML output" ON)
|
|
||||||
option(GTSAM_BUILD_DOC_LATEX "Enable/Disable doxygen LaTeX output" OFF)
|
|
||||||
|
|
||||||
# add a target to generate API documentation with Doxygen
|
|
||||||
if (GTSAM_BUILD_DOCS)
|
|
||||||
# Convert configuration to YES/NO variables
|
|
||||||
if (GTSAM_BUILD_DOC_HTML)
|
|
||||||
set(GTSAM_BUILD_DOC_HTML_YN "YES")
|
|
||||||
else()
|
|
||||||
set(GTSAM_BUILD_DOC_HTML_YN "NO")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (GTSAM_BUILD_DOC_LATEX)
|
|
||||||
set(GTSAM_BUILD_DOC_LATEX_YN "YES")
|
|
||||||
else()
|
|
||||||
set(GTSAM_BUILD_DOC_LATEX_YN "NO")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Generate Doxyfile
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
|
|
||||||
|
|
||||||
# Add target to actually build documentation as configured
|
|
||||||
add_custom_target(doc
|
|
||||||
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc
|
|
||||||
COMMENT "Generating API documentation with Doxygen" VERBATIM
|
|
||||||
)
|
|
||||||
|
|
||||||
# Clean target
|
|
||||||
add_custom_target(doc_clean
|
|
||||||
COMMAND
|
|
||||||
cmake -E remove_directory ${CMAKE_CURRENT_SOURCE_DIR}/doc/latex
|
|
||||||
COMMAND
|
|
||||||
cmake -E remove_directory ${CMAKE_CURRENT_SOURCE_DIR}/doc/html
|
|
||||||
COMMENT "Removing Doxygen documentation"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
# Set up CPack
|
# Set up CPack
|
||||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "GTSAM")
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "GTSAM")
|
||||||
|
|
|
@ -0,0 +1,80 @@
|
||||||
|
# Doxygen documentation configuration
|
||||||
|
option(GTSAM_BUILD_DOCS "Enable/Disable building of doxygen docs" ON)
|
||||||
|
|
||||||
|
# configure doxygen
|
||||||
|
option(GTSAM_BUILD_DOC_HTML "Enable/Disable doxygen HTML output" ON)
|
||||||
|
option(GTSAM_BUILD_DOC_LATEX "Enable/Disable doxygen LaTeX output" OFF)
|
||||||
|
|
||||||
|
# add a target to generate API documentation with Doxygen
|
||||||
|
if (GTSAM_BUILD_DOCS)
|
||||||
|
# Convert configuration to YES/NO variables
|
||||||
|
if (GTSAM_BUILD_DOC_HTML)
|
||||||
|
set(GTSAM_BUILD_DOC_HTML_YN "YES")
|
||||||
|
else()
|
||||||
|
set(GTSAM_BUILD_DOC_HTML_YN "NO")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (GTSAM_BUILD_DOC_LATEX)
|
||||||
|
set(GTSAM_BUILD_DOC_LATEX_YN "YES")
|
||||||
|
else()
|
||||||
|
set(GTSAM_BUILD_DOC_LATEX_YN "NO")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# GTSAM core subfolders
|
||||||
|
set(gtsam_doc_subdirs
|
||||||
|
gtsam/base
|
||||||
|
gtsam/geometry
|
||||||
|
gtsam/inference
|
||||||
|
gtsam/discrete
|
||||||
|
gtsam/linear
|
||||||
|
gtsam/nonlinear
|
||||||
|
gtsam/slam
|
||||||
|
gtsam
|
||||||
|
)
|
||||||
|
|
||||||
|
# Optional GTSAM_UNSTABLE subfolders
|
||||||
|
set(gtsam_unstable_doc_subdirs
|
||||||
|
gtsam_unstable/base
|
||||||
|
gtsam_unstable/discrete
|
||||||
|
gtsam_unstable/linear
|
||||||
|
gtsam_unstable/nonlinear
|
||||||
|
gtsam_unstable/slam
|
||||||
|
gtsam_unstable/dynamics
|
||||||
|
gtsam_unstable
|
||||||
|
)
|
||||||
|
|
||||||
|
# Build a list of folders to include
|
||||||
|
set(doc_subdirs ${gtsam_doc_subdirs})
|
||||||
|
if (GTSAM_BUILD_UNSTABLE)
|
||||||
|
list(APPEND doc_subdirs ${gtsam_unstable_doc_subdirs})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message(STATUS "Doxgyen inputs (raw) [${doc_subdirs}]")
|
||||||
|
|
||||||
|
# From subfolders, build a list with whitespace separation of paths
|
||||||
|
set(GTSAM_DOXYGEN_INPUT_PATHS "")
|
||||||
|
foreach(dir ${doc_subdirs})
|
||||||
|
set(GTSAM_DOXYGEN_INPUT_PATHS "${GTSAM_DOXYGEN_INPUT_PATHS} ${PROJECT_SOURCE_DIR}/${dir}")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
message(STATUS "Doxgyen inputs [${GTSAM_DOXYGEN_INPUT_PATHS}]")
|
||||||
|
|
||||||
|
# Generate Doxyfile
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
|
||||||
|
|
||||||
|
# Add target to actually build documentation as configured
|
||||||
|
add_custom_target(doc
|
||||||
|
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
COMMENT "Generating API documentation with Doxygen" VERBATIM
|
||||||
|
)
|
||||||
|
|
||||||
|
# Clean target
|
||||||
|
add_custom_target(doc_clean
|
||||||
|
COMMAND
|
||||||
|
cmake -E remove_directory ${CMAKE_CURRENT_SOURCE_DIR}/latex
|
||||||
|
COMMAND
|
||||||
|
cmake -E remove_directory ${CMAKE_CURRENT_SOURCE_DIR}/html
|
||||||
|
COMMENT "Removing Doxygen documentation"
|
||||||
|
)
|
||||||
|
endif()
|
|
@ -638,19 +638,7 @@ WARN_LOGFILE =
|
||||||
# directories like "/usr/src/myproject". Separate the files or directories
|
# directories like "/usr/src/myproject". Separate the files or directories
|
||||||
# with spaces.
|
# with spaces.
|
||||||
|
|
||||||
INPUT = @PROJECT_SOURCE_DIR@/gtsam/base \
|
INPUT = @GTSAM_DOXYGEN_INPUT_PATHS@
|
||||||
@PROJECT_SOURCE_DIR@/gtsam/geometry \
|
|
||||||
@PROJECT_SOURCE_DIR@/gtsam/inference \
|
|
||||||
@PROJECT_SOURCE_DIR@/gtsam/discrete \
|
|
||||||
@PROJECT_SOURCE_DIR@/gtsam/linear \
|
|
||||||
@PROJECT_SOURCE_DIR@/gtsam/nonlinear \
|
|
||||||
@PROJECT_SOURCE_DIR@/gtsam
|
|
||||||
# @PROJECT_SOURCE_DIR@/gtsam/slam \
|
|
||||||
# @PROJECT_SOURCE_DIR@/gtsam_unstable/slam \
|
|
||||||
# @PROJECT_SOURCE_DIR@/gtsam_unstable/base \
|
|
||||||
# @PROJECT_SOURCE_DIR@/gtsam_unstable/geometry \
|
|
||||||
# @PROJECT_SOURCE_DIR@/gtsam_unstable/dynamics \
|
|
||||||
# @PROJECT_SOURCE_DIR@/gtsam_unstable
|
|
||||||
|
|
||||||
# This tag can be used to specify the character encoding of the source files
|
# 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
|
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
|
||||||
|
|
Loading…
Reference in New Issue