tests/examples/CMakeLists.txt: remove EXAMPLE_DOC_SOURCE_FILES

The caching is not reliable, and cannot be made so easily.
This commit is contained in:
Daniel Hahler 2017-10-22 15:00:15 +02:00
parent 386e74b852
commit d1d794ab2d
1 changed files with 20 additions and 29 deletions

View File

@ -282,12 +282,8 @@ endfunction()
file(GLOB_RECURSE test_files LIST_DIRECTORIES false
"${TOP_SOURCE_DIR}/tests/examples/*.lua")
# TODO: check for changed files (timestamp)?!
if(NOT "${test_files}" STREQUAL "${EXAMPLE_DOC_SOURCE_FILES}")
set(EXAMPLE_DOC_SOURCE_FILES "${test_files}" CACHE INTERNAL "Source files used to generate doc files.")
# Find and run all test files.
foreach(file ${test_files})
# Find and run all test files.
foreach(file ${test_files})
if ((NOT "${file}" MATCHES ".*/shims/.*")
AND (NOT "${file}" MATCHES ".*/template.lua"))
@ -308,17 +304,12 @@ if(NOT "${test_files}" STREQUAL "${EXAMPLE_DOC_SOURCE_FILES}")
# &quot; wont work in <code>.
string(REPLACE "\"" "'" ${TEST_NAME} ${ESCAPED_CODE_EXAMPLE})
endif()
endforeach()
endforeach()
set(EXAMPLE_DOC_GENERATED_FILES ${EXAMPLE_DOC_GENERATED_FILES}
CACHE INTERNAL "List of generated files for example docs.")
endif()
add_custom_target(generate-examples ALL
DEPENDS ${EXAMPLE_DOC_GENERATED_FILES})
add_custom_target(generate-examples DEPENDS ${EXAMPLE_DOC_GENERATED_FILES})
add_custom_target(check-examples
${CMAKE_COMMAND} -D EXAMPLE_DOC_SOURCE_FILES= ${CMAKE_SOURCE_DIR}
${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
list(APPEND CHECK_TARGETS check-examples)