diff --git a/Modules/FindModuleWrappers/FindLibXml2.cmake b/Modules/FindModuleWrappers/FindLibXml2.cmake index a8b4039..8b4be27 100644 --- a/Modules/FindModuleWrappers/FindLibXml2.cmake +++ b/Modules/FindModuleWrappers/FindLibXml2.cmake @@ -101,7 +101,11 @@ if (LIBXML2_FIND_SYSTEM) SET(INCS ) foreach(DIRSUFF _INCLUDE_DIRS _INCLUDES _INCLUDE_PATH _INCLUDE_DIR) if (DEFINED LIBXML2${DIRSUFF}) - LIST(APPEND INCS ${LIBXML2${DIRSUFF}}) + foreach(FDIR ${LIBXML2${DIRSUFF}}) + if( EXISTS ${FDIR} ) + LIST(APPEND INCS ${FDIR}) + endif() + endforeach() endif() endforeach() my_stupid_package_dependent_message_function_debug_xml2("Include directories: ${INCS}")