# Adapted from bergamote@googlecode

# This module defines
#  LIBXML++_LIBRARY
#  LIBXML++_FOUND
#  LIBXML++_INCLUDE_DIR

IF(LIBXML++_LIBRARY AND LIBXML++_INCLUDE_DIR)
  #already in cache
  SET(LIBXML++_FIND_QUIETLY TRUE)
ENDIF(LIBXML++_LIBRARY AND LIBXML++_INCLUDE_DIR)

IF(NOT WIN32)
  FIND_PATH(LIBXML++_INCLUDE_DIR libxml++.h
            PATHS /usr/include/libxml++-2.6/libxml++)

  FIND_PATH(LIBXML++_CONFIG_INCLUDE_DIR libxml++config.h
            PATHS /usr/lib64/libxml++-2.6/include
                  /usr/lib/libxml++-2.6/include)

  FIND_LIBRARY(LIBXML++_LIBRARY xml++-2.6
               PATHS /usr/lib64 /usr/lib)
ENDIF(NOT WIN32)

IF(LIBXML++_INCLUDE_DIR AND LIBXML++_LIBRARY AND LIBXML++_CONFIG_INCLUDE_DIR)
  SET(LIBXML++_FOUND TRUE)
ELSE(LIBXML++_INCLUDE_DIR AND LIBXML++_LIBRARY AND LIBXML++_CONFIG_INCLUDE_DIR)
  SET(LIBXML++_FOUND FALSE)
ENDIF(LIBXML++_INCLUDE_DIR AND LIBXML++_LIBRARY AND LIBXML++_CONFIG_INCLUDE_DIR)

INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBXML++ DEFAULT_MSG LIBXML++_LIBRARY LIBXML++_INCLUDE_DIR LIBXML++_CONFIG_INCLUDE_DIR)

MARK_AS_ADVANCED(
  LIBXML++_LIBRARY
  LIBXML++_INCLUDE_DIR
  LIBXML++_CONFIG_INCLUDE_DIR)
