summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAdrian Negreanu <adrian.m.negreanu@intel.com>2015-07-28 20:29:20 (GMT)
committerAdrian Negreanu <adrian.m.negreanu@intel.com>2015-08-02 22:24:46 (GMT)
commitec5fde6913935fbe2015220259b611a17a437de3 (patch)
treed16c2ba9cd33d2c0bc379cde14ba59768f2ba1e1 /examples
parent31c5aecbec5200bbfe797cfe8e7c0b565717a96f (diff)
downloadDoxygen-ec5fde6913935fbe2015220259b611a17a437de3.zip
Doxygen-ec5fde6913935fbe2015220259b611a17a437de3.tar.gz
Doxygen-ec5fde6913935fbe2015220259b611a17a437de3.tar.bz2
docs: add examples as a dependency of docs
Diffstat (limited to 'examples')
-rw-r--r--examples/CMakeLists.txt18
1 files changed, 10 insertions, 8 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index d689eda..e7b61a1 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -2,22 +2,24 @@ if (build_doc)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/examples)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/html/examples)
-file(GLOB EXAMPLE_FILES "*")
+file(GLOB EXAMPLE_FILES RELATIVE ${CMAKE_SOURCE_DIR}/examples "*")
if (DOT)
set(DIAGRAM_EXAMPLE ${PROJECT_BINARY_DIR}/html/examples/diagrams/html/index.html)
endif()
-# copy all example files
-add_custom_target(copy_examples)
-foreach(example_file ${EXAMPLE_FILES})
- add_custom_command(TARGET copy_examples PRE_BUILD
- COMMAND ${CMAKE_COMMAND} -E
- copy ${example_file} ${PROJECT_BINARY_DIR}/examples)
+foreach (f ${EXAMPLE_FILES})
+ add_custom_command(
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/examples/${f}" "${PROJECT_BINARY_DIR}/examples/"
+ DEPENDS "${CMAKE_SOURCE_DIR}/examples/${f}"
+ OUTPUT "${PROJECT_BINARY_DIR}/examples/${f}"
+ )
+ set_source_files_properties("${PROJECT_BINARY_DIR}/examples/${f}" PROPERTIES GENERATED 1)
+ list(APPEND OUT_EXAMPLE_FILES "${PROJECT_BINARY_DIR}/examples/${f}")
endforeach()
add_custom_target(examples
- DEPENDS doxygen copy_examples
+ DEPENDS ${OUT_EXAMPLE_FILES}
${PROJECT_BINARY_DIR}/html/examples/class/html/index.html
${PROJECT_BINARY_DIR}/html/examples/define/html/index.html
${PROJECT_BINARY_DIR}/html/examples/enum/html/index.html