-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
8 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,18 +8,11 @@ | |
# Contact KDAB at <[email protected]> for commercial licensing options. | ||
# | ||
|
||
find_program(MKDOCS_EXECUTABLE mkdocs) | ||
if(NOT MKDOCS_EXECUTABLE) | ||
message( | ||
FATAL_ERROR | ||
"\nmkdocs (a project documentation tool using Markdown) could not be found. This tool is required to build the API documentation. Consider installing it by following the directions at https://www.mkdocs.org/user-guide/installation.\nAlso you'll need to 'pip install pymdown-extensions mkdocs-material'\nAlternatively, re-run cmake with the -D${PROJECT_NAME}_DOCS=False option." | ||
) | ||
endif() | ||
|
||
# dot should come with Doxygen find_package(Doxygen) | ||
if(DOXYGEN_DOT_EXECUTABLE) | ||
set(HAVE_DOT "YES") | ||
else() | ||
# cmake-lint: disable=C0301 | ||
set(HAVE_DOT "NO") | ||
message( | ||
STATUS | ||
|
@@ -32,7 +25,6 @@ set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}) | |
|
||
# apidox generation using doxygen | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.cmake ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/mkdocs/mkdocs.yml.cmake ${CMAKE_CURRENT_BINARY_DIR}/mkdocs/mkdocs.yml) | ||
|
||
add_custom_target( | ||
docs | ||
|
@@ -42,24 +34,11 @@ add_custom_target( | |
# copy some files by-hand that are referred to by the markdown README. | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/LICENSES/MIT.txt | ||
${DOXYGEN_OUTPUT_DIR}/mkdocs/docs/license.md | ||
# Run MkDocs to build html documentation | ||
COMMAND ${MKDOCS_EXECUTABLE} build --config-file "${DOXYGEN_OUTPUT_DIR}/mkdocs/mkdocs.yml" --site-dir | ||
"${DOXYGEN_OUTPUT_DIR}/html" | ||
DEPENDS ${_dox_deps} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile | ||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} | ||
COMMENT "Building Documentation" | ||
) | ||
|
||
add_custom_command( | ||
TARGET docs | ||
POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --cyan "" | ||
COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --cyan "Built MkDocs documentation" | ||
COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --cyan | ||
"Use 'mkdocs serve' in the '${DOXYGEN_OUTPUT_DIR}/mkdocs' directory to view the documentation." | ||
COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --cyan "" | ||
VERBATIM | ||
) | ||
# The tags file is only created when 'make docs' is run first | ||
if(EXISTS "${DOXYGEN_OUTPUT_DIR}/kdbindings.tags") | ||
install(FILES ${DOXYGEN_OUTPUT_DIR}/kdbindings.tags DESTINATION ${INSTALL_DOC_DIR}) | ||
|
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