-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build sphinx/doxygen docs with CMake #201
Merged
cary-ilm
merged 9 commits into
AcademySoftwareFoundation:master
from
cary-ilm:cmake-docs
Aug 30, 2021
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3339170
Build sphinx/doxygen docs with CMake
cary-ilm 499b96d
Add copyright/license
cary-ilm eeb623c
Fix dependencies
cary-ilm 11879ae
Restore conf.py for RTD
cary-ilm 09e102e
Fix typo in conf.py for RTD
cary-ilm b353d62
typo
cary-ilm 0b6ba42
Merge branch 'master' into cmake-docs
cary-ilm fa83a51
Fix merge
cary-ilm 8b3ff2d
Remove Doxyfile
cary-ilm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,49 @@ | ||
# 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}/docs/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(CONF_PY_IN ${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in) | ||
set(CONF_PY_OUT ${CMAKE_CURRENT_BINARY_DIR}/conf.py) | ||
|
||
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) | ||
configure_file(${CONF_PY_IN} ${CONF_PY_OUT} @ONLY) | ||
|
||
file(MAKE_DIRECTORY ${DOXYGEN_OUTPUT_DIR}) | ||
|
||
add_custom_command(OUTPUT ${DOXYGEN_INDEX_FILE} | ||
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT} | ||
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 | ||
-c ${CMAKE_CURRENT_BINARY_DIR} | ||
${SPHINX_SOURCE} ${SPHINX_BUILD} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
DEPENDS ${DOXYGEN_INDEX_FILE} | ||
MAIN_DEPENDENCY ${CONF_PY_OUT} | ||
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh, I didn't know about this!