#
# Create CMake file structure in the current binary dir:
#
- set(_base_directory "${CMAKE_CURRENT_SOURCE_DIR}")
+ set(_base_directory "${CMAKE_CURRENT_SOURCE_DIR}")
set(_source_directory "${CMAKE_CURRENT_BINARY_DIR}/source")
set(_binary_directory "${CMAKE_CURRENT_BINARY_DIR}/binary")
message(STATUS "Temporary source directory: ${_source_directory}")
enable_testing()
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/CTestFile.cmake" "subdirs(binary)")
- # and now call into the second half of our setup in the writable "source"
- # directory:
+ #
+ # and call into the freshly created "source" directory:
+ #
add_subdirectory(${_source_directory} ${_binary_directory})
endif()
#
-# Parse all diff files...
+# We now parse all diff files and create rules to generate the step-*.cc
+# files.
+#
+# Here, ${_base_directory} points to the base "tests/examples" directory,
+# and ${DEAL_II_SOURCE_DIR} points to the deal.II main repository root.
#
file(GLOB _diff_files "${_base_directory}/*.diff")
foreach(_diff_file ${_diff_files})
get_filename_component(_step "${_diff_file}" NAME_WLE)
set(_source_file "${DEAL_II_SOURCE_DIR}/examples/${_step}/${_step}.cc")
- set(_output_file "${_source_directory}/${_step}.cc")
+ set(_output_file "${CMAKE_CURRENT_SOURCE_DIR}/${_step}.cc")
# ... and create a rule that updates all diff files if necessary during
# testsuite invocation:
file(GLOB _output_files "${_base_directory}/${_step}*.output*")
foreach(_file ${_output_files})
get_filename_component(_destination "${_file}" NAME)
- set(_destination "${_source_directory}/${_destination}")
+ set(_destination "${CMAKE_CURRENT_SOURCE_DIR}/${_destination}")
file(CREATE_LINK ${_file} ${_destination} SYMBOLIC)
endforeach()
endforeach()
if [[ -f "${source_file}" && -f "${modified_file}" ]]; then
echo diff "${source_file}" "${modified_file}" "${file}"
diff -c "${source_file}" "${modified_file}" > "${file}"
- echo success
else
echo "No matching .cc files found for ${file}"
exit 1