INCLUDE(FindPkgConfig)

PKG_CHECK_MODULES (DIRECTFB REQUIRED directfb)
PKG_CHECK_MODULES (DIRECTFB_INTERNAL REQUIRED directfb-internal)
PKG_CHECK_MODULES (DIRECTFB_EGL REQUIRED egl)

SET( DirectFB_FOUND "NO" )
IF(DIRECTFB_LIBRARIES)
  message(STATUS "Found DirectFB ldflags: ${DIRECTFB_LDFLAGS}")
  message(STATUS "Found DirectFB libraries: ${DIRECTFB_LIBRARIES}")
  IF(DIRECTFB_INTERNAL_INCLUDE_DIRS)
    SET( DirectFB_FOUND "YES" )
    message(STATUS "Found DirectFB-internal includes: ${DIRECTFB_INTERNAL_INCLUDE_DIRS}")
  ENDIF()
  IF(DIRECTFB_EGL_LIBRARIES)
    message(STATUS "Found DirectFB-EGL ldflags: ${DIRECTFB_EGL_LDFLAGS}")
    message(STATUS "Found DirectFB-EGL libraries: ${DIRECTFB_EGL_LIBRARIES}")
    message(STATUS "Found DirectFB-EGL includes: ${DIRECTFB_EGL_INCLUDE_DIRS}")
  ENDIF()
ENDIF()

MARK_AS_ADVANCED(
  DIRECTFB_LDFLAGS
  DIRECTFB_LIBRARIES
  DIRECTFB_INTERNAL_INCLUDE_DIRS
  DIRECTFB_EGL_LDFLAGS
  DIRECTFB_EGL_LIBRARIES
  DIRECTFB_EGL_INCLUDE_DIRS
)
