-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build sphinx/doxygen docs with CMake (#201)
* Build sphinx/doxygen docs with CMake * The DOCS CMake option runs doxygen and sphinx to build the html documentation. Default if OFF. If ON, it requires doxygen and sphinx to be installed (found via FindSphinx.cmake). * Describe the documentation generation option in INSTALL.md. * Fix broken references in half.rst. * Remove quotes around some template function names in doxygen comments that result in unresolved references. Signed-off-by: Cary Phillips <[email protected]> * Add copyright/license Signed-off-by: Cary Phillips <[email protected]> * Fix dependencies Signed-off-by: Cary Phillips <[email protected]> * Restore conf.py for RTD Signed-off-by: Cary Phillips <[email protected]> * Fix typo in conf.py for RTD Signed-off-by: Cary Phillips <[email protected]> * typo Signed-off-by: Cary Phillips <[email protected]> * Fix merge Signed-off-by: Cary Phillips <[email protected]> * Remove Doxyfile Signed-off-by: Cary Phillips <[email protected]>
- Loading branch information
Showing
11 changed files
with
143 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#Look for an executable called sphinx-build | ||
find_program(SPHINX_EXECUTABLE | ||
NAMES sphinx-build | ||
DOC "Path to sphinx-build executable") | ||
|
||
include(FindPackageHandleStandardArgs) | ||
|
||
#Handle standard arguments to find_package like REQUIRED and QUIET | ||
find_package_handle_standard_args(Sphinx | ||
"Failed to find sphinx-build executable" | ||
SPHINX_EXECUTABLE) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright Contributors to the OpenEXR Project. | ||
|
||
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) | ||
|
||
find_package(Doxygen REQUIRED) | ||
find_package(Sphinx REQUIRED) | ||
|
||
set(DOXYGEN_INPUT_DIR ${PROJECT_SOURCE_DIR}/src/Imath) | ||
set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/doxygen) | ||
set(DOXYGEN_INDEX_FILE ${DOXYGEN_OUTPUT_DIR}/html/index.html) | ||
set(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in) | ||
set(DOXYFILE_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) | ||
|
||
set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/sphinx) | ||
set(SPHINX_INDEX_FILE ${SPHINX_BUILD}/index.html) | ||
|
||
configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY) | ||
|
||
file(MAKE_DIRECTORY ${DOXYGEN_OUTPUT_DIR}) | ||
|
||
add_custom_command(OUTPUT ${DOXYGEN_INDEX_FILE} | ||
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT} | ||
MAIN_DEPENDENCY ${DOXYFILE_OUT} ${DOXYFILE_IN} | ||
COMMENT "Running doxygen" | ||
VERBATIM) | ||
|
||
add_custom_target(Doxygen ALL DEPENDS ${DOXYGEN_INDEX_FILE}) | ||
|
||
add_custom_command(OUTPUT ${SPHINX_INDEX_FILE} | ||
COMMAND | ||
${SPHINX_EXECUTABLE} -b html | ||
# Tell Breathe where to find the Doxygen output | ||
-Dbreathe_projects.Imath=${DOXYGEN_OUTPUT_DIR}/xml | ||
${SPHINX_SOURCE} ${SPHINX_BUILD} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
DEPENDS ${DOXYGEN_INDEX_FILE} | ||
MAIN_DEPENDENCY conf.py | ||
COMMENT "Generating documentation with Sphinx") | ||
|
||
add_custom_target(Sphinx ALL DEPENDS ${SPHINX_INDEX_FILE}) | ||
|
||
# Add an install target to install the docs | ||
include(GNUInstallDirs) | ||
install(DIRECTORY ${SPHINX_BUILD} | ||
DESTINATION ${CMAKE_INSTALL_DOCDIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters