Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 2 additions & 72 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ============================================================================ #
# Copyright (c) 2024 NVIDIA Corporation & Affiliates. #
# Copyright (c) 2024 - 2025 NVIDIA Corporation & Affiliates. #
# All rights reserved. #
# #
# This source code and the accompanying materials are made available under #
Expand All @@ -25,13 +25,6 @@ foreach(lib ${CUDAQX_ALL_LIBS})
list(APPEND CUDAQX_PUBLIC_PYTHON ${LIB_PUBLIC_PYTHON})
endforeach()

# Find all the rst files
set(CUDAQX_PUBLIC_RST)
foreach(lib ${CUDAQX_ALL_LIBS})
file(GLOB_RECURSE RST_FILES "*.rst")
list(APPEND CUDAQX_PUBLIC_RST ${RST_FILES})
endforeach()

# ==============================================================================
# Doxygen
# ==============================================================================
Expand All @@ -58,69 +51,6 @@ add_custom_command(

add_custom_target(doxygen_docs DEPENDS ${DOXYGEN_INDEX_FILE})

# ==============================================================================
# Sphinx
# ==============================================================================

find_package(Python COMPONENTS Interpreter REQUIRED)

function(require_python_module module_name)
execute_process(
COMMAND ${Python_EXECUTABLE} -c "import ${module_name}"
RESULT_VARIABLE result
OUTPUT_QUIET
ERROR_QUIET
)
if(NOT result EQUAL 0)
message(FATAL_ERROR "Python module '${module_name}' not found")
endif()
endfunction()

require_python_module(IPython)
require_python_module(breathe)
require_python_module(enum_tools)
require_python_module(myst_parser)
require_python_module(nbsphinx)
require_python_module(sphinx_copybutton)
require_python_module(sphinx_inline_tabs)
require_python_module(sphinx_gallery)
require_python_module(sphinx_rtd_theme)
require_python_module(sphinx_reredirects)
require_python_module(sphinx_toolbox)

set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/sphinx)
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/build)
set(SPHINX_INDEX_FILE ${SPHINX_BUILD}/index.html)

set(SPHINX_CONF_IN ${SPHINX_SOURCE}/conf.py.in)
set(SPHINX_CONF ${CMAKE_CURRENT_BINARY_DIR}/conf.py)

configure_file(${SPHINX_CONF_IN} ${SPHINX_CONF} @ONLY)

# Only regenerate Sphinx when:
# - Doxygen has rerun
# - Our doc files have been updated
# - The Sphinx config has been updated
# TODO: set warning as error (-W flag)
add_custom_command(
OUTPUT ${SPHINX_INDEX_FILE}
COMMAND ${SPHINX_EXECUTABLE} -v -n --keep-going -b html
-c ${CMAKE_CURRENT_BINARY_DIR}
-Dbreathe_projects.cudaqx=${DOXYGEN_OUTPUT_DIR}/xml
${SPHINX_SOURCE} ${SPHINX_BUILD}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS
${SPHINX_SOURCE}/index.rst
${DOXYGEN_INDEX_FILE}
cudaqx-pymodules
${CUDAQX_PUBLIC_PYTHON}
${CUDAQX_PUBLIC_RST}
MAIN_DEPENDENCY ${SPHINX_CONF_IN} ${SPHINX_CONF}
COMMENT "Generating documentation with Sphinx"
)

add_custom_target(sphinx_docs DEPENDS ${SPHINX_INDEX_FILE})

# ==============================================================================

add_custom_target(docs DEPENDS doxygen_docs sphinx_docs)
add_custom_target(docs DEPENDS doxygen_docs)
13 changes: 11 additions & 2 deletions docs/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,18 @@ ALIASES += "pure_device_kernel=\par This function is a pure-device CUDA-Q quantu
# Build related configuration options
#---------------------------------------------------------------------------

EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = YES
WARN_AS_ERROR = FAIL_ON_WARNINGS
WARN_IF_INCOMPLETE_DOC = NO
WARN_IF_UNDOCUMENTED = NO

#---------------------------------------------------------------------------
# Configuration options related to the input files
#---------------------------------------------------------------------------

EXCLUDE_SYMBOLS = "classcudaqx_1_1*"

#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
Expand Down
Loading
Loading