# -*- cmake -*-

# - Find libnotify
# Find the libnotify includes and library
# This module defines
#  LIBNOTIFY_INCLUDE_DIR, where to find notify.h, etc.
#  LIBNOTIFY_LIBRARIES, the libraries needed to use libnotify.
#  LIBNOTIFY_FOUND, If false, do not try to use libnotify.
# also defined, but not for general use are
#  LIBNOTIFY_LIBRARY, where to find the libnotify library.

FIND_PATH(LIBNOTIFY_INCLUDE_DIR notify.h
  PATH_SUFFIXES libnotify
  )

SET(LIBNOTIFY_NAMES ${LIBNOTIFY_NAMES} notify)
FIND_LIBRARY(LIBNOTIFY_LIBRARY
  NAMES ${LIBNOTIFY_NAMES}
  )

IF (LIBNOTIFY_LIBRARY AND LIBNOTIFY_INCLUDE_DIR)
    SET(LIBNOTIFY_LIBRARIES ${LIBNOTIFY_LIBRARY})
    SET(LIBNOTIFY_FOUND "YES")
ELSE (LIBNOTIFY_LIBRARY AND LIBNOTIFY_INCLUDE_DIR)
  SET(LIBNOTIFY_FOUND "NO")
ENDIF (LIBNOTIFY_LIBRARY AND LIBNOTIFY_INCLUDE_DIR)


IF (LIBNOTIFY_FOUND)
   IF (NOT LIBNOTIFY_FIND_QUIETLY)
      MESSAGE(STATUS "Found libnotify: '${LIBNOTIFY_LIBRARIES}' and header in '${LIBNOTIFY_INCLUDE_DIR}'")
   ENDIF (NOT LIBNOTIFY_FIND_QUIETLY)
ELSE (LIBNOTIFY_FOUND)
   IF (LIBNOTIFY_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could not find libnotify library")
   ENDIF (LIBNOTIFY_FIND_REQUIRED)
ENDIF (LIBNOTIFY_FOUND)

# Deprecated declarations.
SET (NATIVE_LIBNOTIFY_INCLUDE_PATH ${LIBNOTIFY_INCLUDE_DIR} )
GET_FILENAME_COMPONENT (NATIVE_LIBNOTIFY_LIB_PATH ${LIBNOTIFY_LIBRARY} PATH)

MARK_AS_ADVANCED(
  LIBNOTIFY_LIBRARY
  LIBNOTIFY_INCLUDE_DIR
  )
