Skip to content

Commit

Permalink
docs/CMakeLists.txt: documentation
Browse files Browse the repository at this point in the history
Swift SVN r4505
  • Loading branch information
Dave Abrahams committed Mar 28, 2013
1 parent 0abc1da commit 96cc492
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,26 @@ find_program(LITRE_EXECUTABLE
DOC "LitRe literate programming tool for docutils")

if(LITRE_EXECUTABLE)
# Make the LitreTesting cmake module available
execute_process(
COMMAND ${LITRE_EXECUTABLE} --cmake_module_path
OUTPUT_VARIABLE litre_cmake_module_path
OUTPUT_STRIP_TRAILING_WHITESPACE
)
list(APPEND CMAKE_MODULE_PATH ${litre_cmake_module_path})

# Find all the .rst files
file(GLOB_RECURSE rst_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rst)

foreach(rst ${rst_files})
# Prepare a testing directory containing a CMakeLists.txt
# and example files extracted from the .rst
set(test_dir ${CMAKE_CURRENT_BINARY_DIR}/litre-tests/${rst}.litre-tests)
execute_process(
COMMAND ${CMAKE_COMMAND} -E make_directory "${test_dir}"
COMMAND ${LITRE_EXECUTABLE} --dump_dir=${test_dir} --traceback ${CMAKE_CURRENT_SOURCE_DIR}/${rst}
)
# Make that directory part of the build
add_subdirectory(${test_dir} ${test_dir}/build)
endforeach()
else()
Expand Down

0 comments on commit 96cc492

Please sign in to comment.