Run CMake.HTML test with older xmllint (#10857)

Old versions of xmllint do not have --nonet or --path options.
Fall back to the network-access form in this case.
This commit is contained in:
Brad King 2010-06-23 07:38:33 -04:00
parent 8c0e79f824
commit 1819d9d617

View File

@ -138,6 +138,9 @@ if(BUILD_TESTING)
endif() endif()
mark_as_advanced(LIBXML2_XMLLINT_EXECUTABLE) mark_as_advanced(LIBXML2_XMLLINT_EXECUTABLE)
if(LIBXML2_XMLLINT_EXECUTABLE) if(LIBXML2_XMLLINT_EXECUTABLE)
execute_process(COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --help
OUTPUT_VARIABLE _help ERROR_VARIABLE _err)
if("${_help}" MATCHES "--path" AND "${_help}" MATCHES "--nonet")
# We provide the XHTML DTD and its dependencies in the 'xml' # We provide the XHTML DTD and its dependencies in the 'xml'
# directory so that xmllint can run without network access. # directory so that xmllint can run without network access.
# However, it's --path option accepts a space-separated list of # However, it's --path option accepts a space-separated list of
@ -149,5 +152,10 @@ if(BUILD_TESTING)
${LIBXML2_XMLLINT_EXECUTABLE} --valid --noout --nonet --path . ${LIBXML2_XMLLINT_EXECUTABLE} --valid --noout --nonet --path .
${HTML_FILES} ${HTML_FILES}
) )
else()
add_test(CMake.HTML
${LIBXML2_XMLLINT_EXECUTABLE} --valid --noout ${HTML_FILES}
)
endif()
endif() endif()
endif() endif()