FIND_PATH(UDEV_INCLUDE_DIR libudev.h /usr/include /usr/local/include)

FIND_LIBRARY(UDEV_LIBRARY NAMES udev libudev PATH /usr/lib /usr/local/lib)

IF(UDEV_INCLUDE_DIR AND UDEV_LIBRARY)
	SET(UDEV_FOUND TRUE)
ENDIF(UDEV_INCLUDE_DIR AND UDEV_LIBRARY)

IF(UDEV_FOUND)
	IF(NOT UDEV_FIND_QUIETLY)
		MESSAGE(STATUS "Found UDev: ${UDEV_LIBRARY}")
	ENDIF(NOT UDEV_FIND_QUIETLY)
ELSE(UDEV_FOUND)
	IF(UDEV_FIND_REQUIRED)
		IF(NOT UDEV_INCLUDE_DIR)
			MESSAGE(FATAL_ERROR "Could not find UDev header file!")
		ENDIF(NOT UDEV_INCLUDE_DIR)

		IF(NOT UDEV_LIBRARY)
			MESSAGE(FATAL_ERROR "Could not find UDev library files!")
		ENDIF(NOT UDEV_LIBRARY)
	ENDIF(UDEV_FIND_REQUIRED)
ENDIF(UDEV_FOUND)
