@@ -446,6 +446,19 @@ if (MFC_SYSCHECK)
446446endif ()
447447
448448if (MFC_DOCUMENTATION)
449+ # Files in docs/examples are used to generate docs/documentation/examples.md
450+ file (GLOB_RECURSE examples_DOCs CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR} /docs/examples/*" )
451+
452+ add_custom_command (
453+ OUTPUT "${CMAKE_CURRENT_SOURCE_DIR} /docs/documentation/examples.md"
454+ DEPENDS "${examples_DOCs} "
455+ COMMAND "bash" "${CMAKE_CURRENT_SOURCE_DIR} /docs/examples.sh"
456+ "${CMAKE_CURRENT_SOURCE_DIR} "
457+ COMMENT "Generating examples.md"
458+ )
459+
460+ file (GLOB common_DOCs CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR} /docs/*" )
461+
449462 # GEN_DOCS: Given a target name (herein <target>), this macro sets up a
450463 # target, <target>_docs, that generates documentation for <target> using
451464 # Doxygen. It is then added as a dependency of the documentation target.
@@ -472,13 +485,20 @@ if (MFC_DOCUMENTATION)
472485 "${CMAKE_CURRENT_SOURCE_DIR} /docs/Doxyfile.in"
473486 "${CMAKE_CURRENT_BINARY_DIR} /${target} -Doxyfile" @ONLY)
474487
488+ set (opt_example_dependency "" )
489+ if (target STREQUAL "documentation" )
490+ set (opt_example_dependency "${CMAKE_CURRENT_SOURCE_DIR} /docs/documentation/examples.md" )
491+ endif ()
492+
493+ file (GLOB_RECURSE ${target} _DOCs CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR} /docs/${target} /*" )
494+ list (APPEND ${target} _DOCs "${common_DOCs} " )
495+
475496 add_custom_command (
476497 OUTPUT "${CMAKE_CURRENT_BINARY_DIR} /${target} /html/index.html"
477498 DEPENDS "${CMAKE_CURRENT_BINARY_DIR} /${target} -Doxyfile"
478- "${${target} _SRCs}"
479- COMMAND "bash" "${CMAKE_CURRENT_SOURCE_DIR} /docs/examples.sh"
480- "${CMAKE_CURRENT_SOURCE_DIR} " &&
481- "${DOXYGEN_EXECUTABLE} " "${target} -Doxyfile"
499+ "${opt_example_dependency} "
500+ "${${target} _SRCs}" "${${target} _DOCs}"
501+ COMMAND "${DOXYGEN_EXECUTABLE} " "${target} -Doxyfile"
482502 WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR} "
483503 COMMENT "${target} : Generating documentation"
484504 )
@@ -503,7 +523,7 @@ if (MFC_DOCUMENTATION)
503523 ExternalProject_Add(doxygen-awesome-css
504524 PREFIX doxygen-awesome-css
505525 GIT_REPOSITORY "https://github.com/jothepro/doxygen-awesome-css"
506- GIT_TAG "df83fbf22cfff76b875c13d324baf584c74e96d0 "
526+ GIT_TAG "df88fe4fdd97714fadfd3ef17de0b4401f804052 "
507527 CONFIGURE_COMMAND ""
508528 BUILD_COMMAND ""
509529 INSTALL_COMMAND ""
0 commit comments