#####################################################################
# XERCES
FIND_PATH(CMAKE_XERCES_INCLUDE NAMES xercesc/util/XercesVersion.hpp
  PATHS
  $ENV{CMAKE_XERCES_INCLUDE_PATH}
  ${CMAKE_XERCES_INCLUDE_PATH}
  ${CMAKE_INCLUDE_PATH}
  /usr/local/include
  /usr/include
  )
FIND_LIBRARY(CMAKE_XERCES_LIBRARY NAMES xerces-c-3.0 xerces-c-3.1
  PATHS
  $ENV{CMAKE_XERCES_LIBRARY_PATH}
  ${CMAKE_XERCES_LIBRARY_PATH}
  ${CMAKE_LIBRARY_PATH}
  /usr/lib
  /usr/local/lib
  )

IF(CMAKE_XERCES_INCLUDE AND CMAKE_XERCES_LIBRARY)
  SET(CMAKE_XERCES_FOUND TRUE)
ELSE(CMAKE_XERCES_INCLUDE AND CMAKE_XERCES_LIBRARY)
  SET(CMAKE_XERCES_FOUND FALSE)
ENDIF(CMAKE_XERCES_INCLUDE AND CMAKE_XERCES_LIBRARY)

IF(CMAKE_XERCES_FOUND)
  MESSAGE(STATUS "Found Xerces-C")
ELSE(CMAKE_XERCES_FOUND)
  MESSAGE(FATAL_ERROR "Couldn't find Xerces-C")
ENDIF(CMAKE_XERCES_FOUND)

MARK_AS_ADVANCED(CMAKE_XERCES_INCLUDE CMAKE_XERCES_LIBRARY)
