# - Try to find xgettext
# Once done this will define
#
#  XGETTEXT_FOUND - system has Iconv
#  GETTEXT_XGETTEXT_EXECUTABLE: the full path to the xgettext tool.
#

IF (GETTEXT_XGETTEXT_EXECUTABLE)
  # Already in cache, be silent
  SET (XGETTEXT_FIND_QUIETLY TRUE)
ENDIF (GETTEXT_XGETTEXT_EXECUTABLE)

FIND_PROGRAM(GETTEXT_XGETTEXT_EXECUTABLE xgettext)
IF (GETTEXT_XGETTEXT_EXECUTABLE)
  SET(XGETTEXT_FOUND TRUE)
  IF (NOT XGETTEXT_FIND_QUIETLY)
    MESSAGE(STATUS "Found xgettext: ${GETTEXT_XGETTEXT_EXECUTABLE}")
  ENDIF (NOT XGETTEXT_FIND_QUIETLY)
ELSE (GETTEXT_XGETTEXT_EXECUTABLE)
  SET(XGETTEXT_FOUND FALSE)
  IF (XGettext_REQUIRED)
    MESSAGE(FATAL_ERROR "xgettext not found")
  ENDIF (XGetText_REQUIRED)
ENDIF (GETTEXT_XGETTEXT_EXECUTABLE)

