Skip to content
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

Fix building docs from subprojects by not using CMAKE_SOURCE_DIR #6016

Merged
merged 1 commit into from
Sep 25, 2024
Merged
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
16 changes: 11 additions & 5 deletions cmake-modules/AzureDoxygen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ function(generate_documentation PROJECT_NAME PROJECT_VERSION)
set(DOXYGEN_PROJECT_NAME ${PROJECT_NAME})
set(DOXYGEN_PROJECT_NUMBER ${PROJECT_VERSION})

# Doc assets are needed from the top-level SDK directory.
# CMAKE_SOURCE_DIR will not point there if building from a subproject
# like sdk/core/azure-core, so use PROJECT_SOURCE_DIR instead.
# Subprojects are assumed to always be 3 levels down from the root.
set(SDK_ROOT_DIR ${PROJECT_SOURCE_DIR}/../../..)
chewi marked this conversation as resolved.
Show resolved Hide resolved

set(DOXYGEN_OUTPUT_DIRECTORY docs)
set(DOXYGEN_LAYOUT_FILE ${CMAKE_SOURCE_DIR}/eng/docs/api/assets/DoxygenLayout.xml)
set(DOXYGEN_LAYOUT_FILE ${SDK_ROOT_DIR}/eng/docs/api/assets/DoxygenLayout.xml)
set(DOXYGEN_RECURSIVE YES)
if (MSVC)
set(DOXYGEN_WARN_FORMAT "$file($line) : $text")
Expand Down Expand Up @@ -45,10 +51,10 @@ function(generate_documentation PROJECT_NAME PROJECT_VERSION)
az_
AZ_
)
set(DOXYGEN_HTML_HEADER ${CMAKE_SOURCE_DIR}/eng/docs/api/assets/header.html)
set(DOXYGEN_HTML_FOOTER ${CMAKE_SOURCE_DIR}/eng/docs/api/assets/footer.html)
set(DOXYGEN_HTML_STYLESHEET ${CMAKE_SOURCE_DIR}/eng/docs/api/assets/style.css)
set(DOXYGEN_PROJECT_LOGO ${CMAKE_SOURCE_DIR}/eng/common/docgeneration/assets/logo.svg)
set(DOXYGEN_HTML_HEADER ${SDK_ROOT_DIR}/eng/docs/api/assets/header.html)
set(DOXYGEN_HTML_FOOTER ${SDK_ROOT_DIR}/eng/docs/api/assets/footer.html)
set(DOXYGEN_HTML_STYLESHEET ${SDK_ROOT_DIR}/eng/docs/api/assets/style.css)
set(DOXYGEN_PROJECT_LOGO ${SDK_ROOT_DIR}/eng/common/docgeneration/assets/logo.svg)

set(DOXYGEN_GENERATE_XML YES)
set(DOXYGEN_GENERATE_LATEX NO)
Expand Down