Simplify CMake.HTML documentation test command line

Drop the "cmake -E chdir" wrapper and instead pass the DTD directory to
xmllint's --path option using url encoding.  While at it, move the
XHTML1 DTD to "Utilities/xml/xhtml1" to make room for additional DTDs.
This commit is contained in:
Daniel Pfeifer 2012-09-06 12:31:47 +02:00 committed by Brad King
parent 2da17ef797
commit 2f520d304a
5 changed files with 8 additions and 8 deletions

View File

@ -141,15 +141,15 @@ if(BUILD_TESTING)
execute_process(COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --help execute_process(COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --help
OUTPUT_VARIABLE _help ERROR_VARIABLE _err) OUTPUT_VARIABLE _help ERROR_VARIABLE _err)
if("${_help}" MATCHES "--path" AND "${_help}" MATCHES "--nonet") if("${_help}" MATCHES "--path" AND "${_help}" MATCHES "--nonet")
# We provide the XHTML DTD and its dependencies in the 'xml' # We provide DTDs in the 'xml' directory so that xmllint can run without
# directory so that xmllint can run without network access. # network access. Note that xmllints's --path option accepts a
# However, it's --path option accepts a space-separated list of # space-separated list of url-encoded paths.
# paths so it cannot handle spaces in the path to the source tree. set(_dtd_dir "${CMAKE_CURRENT_SOURCE_DIR}/xml")
# Therefore we run the tool with the current work directory set to string(REPLACE " " "%20" _dtd_dir "${_dtd_dir}")
# the 'xml' directory and use '.' as the path. string(REPLACE ":" "%3A" _dtd_dir "${_dtd_dir}")
add_test(CMake.HTML add_test(CMake.HTML
${CMAKE_CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR}/xml ${LIBXML2_XMLLINT_EXECUTABLE} --valid --noout --nonet
${LIBXML2_XMLLINT_EXECUTABLE} --valid --noout --nonet --path . --path ${_dtd_dir}/xhtml1
${HTML_FILES} ${HTML_FILES}
) )
endif() endif()