Skip to content

Commit

Permalink
CMake Docs-gen: Fix call to examples.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
henryleberre committed Dec 14, 2023
1 parent 7994f5d commit 6be725d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -446,15 +446,16 @@ if (MFC_SYSCHECK)
endif()

if (MFC_DOCUMENTATION)
# Files in docs/examples are used to generate docs/documentation/examples.md
file(GLOB_RECURSE examples_DOCs CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/docs/examples/*")
# Files in examples/ are used to generate docs/documentation/examples.md
file(GLOB_RECURSE examples_DOCs CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/examples/*")

add_custom_command(
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/examples.md"
DEPENDS "${examples_DOCs}"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/docs/examples.sh;${examples_DOCs}"
COMMAND "bash" "${CMAKE_CURRENT_SOURCE_DIR}/docs/examples.sh"
"${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT "Generating examples.md"
VERBATIM
)

file(GLOB common_DOCs CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/docs/*")
Expand Down Expand Up @@ -486,7 +487,7 @@ if (MFC_DOCUMENTATION)
"${CMAKE_CURRENT_BINARY_DIR}/${target}-Doxyfile" @ONLY)

set(opt_example_dependency "")
if (target STREQUAL "documentation")
if (${target} STREQUAL documentation)
set(opt_example_dependency "${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/examples.md")
endif()

Expand Down

0 comments on commit 6be725d

Please sign in to comment.