-
-
Notifications
You must be signed in to change notification settings - Fork 507
build: add doc target #384
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 hidden or 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 |
|---|---|---|
|
|
@@ -440,6 +440,73 @@ if (ZYDIS_BUILD_TOOLS AND NOT ZYAN_NO_LIBC) | |
| endif () | ||
| endif () | ||
|
|
||
| # =============================================================================================== # | ||
| # Doxygen documentation # | ||
| # =============================================================================================== # | ||
|
|
||
| find_package(Doxygen) | ||
| if (DOXYGEN_FOUND) | ||
| find_file(DOXYGEN_AWESOME_CSS | ||
| "doxygen-awesome.css" | ||
| PATHS "." ".." "/usr/share" | ||
| PATH_SUFFIXES "doxygen-awesome-css" | ||
| NO_DEFAULT_PATH | ||
| ) | ||
| find_file(DOXYGEN_AWESOME_SIDEBAR_ONLY_CSS | ||
| "doxygen-awesome-sidebar-only.css" | ||
| PATHS "." ".." "/usr/share" | ||
| PATH_SUFFIXES "doxygen-awesome-css" | ||
| NO_DEFAULT_PATH | ||
| ) | ||
|
|
||
| # Read Doxygen options from the Doxyfile and set them as CMake variables | ||
| # to accomodate doxygen_add_docs() | ||
| file(READ "Doxyfile" DOXYFILE) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: this temporary variable |
||
| # Remove comments | ||
| string(REGEX REPLACE "\n?#[^\n]*\n" "" DOXYFILE ${DOXYFILE}) | ||
| # Remove empty lines | ||
| string(REGEX REPLACE "\n[ \t\r\n]" "\n" DOXYFILE "${DOXYFILE}") | ||
| # Strip leading and trailing spaces | ||
| string(STRIP "${DOXYFILE}" DOXYFILE) | ||
| # Tranform the file in a list of '='-separated options | ||
| string(REPLACE "\n" ";" DOXYFILE "${DOXYFILE}") | ||
|
|
||
| foreach(option IN LISTS DOXYFILE) | ||
| string(REPLACE "=" ";" option "${option}") | ||
| list(GET option 0 opt_name) | ||
| list(GET option 1 opt_value) | ||
| string(STRIP "${opt_name}" opt_name) | ||
| string(STRIP "${opt_value}" opt_value) | ||
|
|
||
| if (opt_name STREQUAL "INPUT") | ||
| # Save the INPUTs in a list to be used later | ||
| string(REGEX REPLACE "[ ]+" ";" DOC_PATHS "${opt_value}") | ||
| # Skip as the input files are not set by a DOXYGEN_INPUT variable | ||
| continue() | ||
| endif() | ||
|
|
||
| if (opt_name STREQUAL "OUTPUT_DIRECTORY") | ||
| # Skip as CMake writes the output files in the build directory | ||
| continue() | ||
| endif() | ||
|
|
||
| set("DOXYGEN_${opt_name}" ${opt_value}) | ||
| endforeach() | ||
|
|
||
| set(DOXYGEN_QUIET YES) | ||
| set(DOXYGEN_WARNINGS NO) | ||
| set(DOXYGEN_WARN_IF_UNDOCUMENTED NO) | ||
| set(DOXYGEN_HTML_EXTRA_STYLESHEET "${DOXYGEN_AWESOME_CSS}" "${DOXYGEN_AWESOME_SIDEBAR_ONLY_CSS}") | ||
|
|
||
| doxygen_add_docs(doc ${DOC_PATHS} ALL) | ||
|
|
||
| install( | ||
| DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html/" | ||
| DESTINATION "${CMAKE_INSTALL_DOCDIR}/api" | ||
| COMPONENT Documentation | ||
| ) | ||
| endif() | ||
|
|
||
| # =============================================================================================== # | ||
| # Manpages # | ||
| # =============================================================================================== # | ||
|
|
||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.