if(AVUTIL_INCLUDE_DIR AND AVUTIL_LIBRARIES)
	unset(AVUTIL_INCLUDE_DIR)
	unset(AVUTIL_LIBRARIES)
endif()

if (AVUTIL_ROOT)
	find_path(AVUTIL_INCLUDE_DIR libavutil/avutil.h PATHS ${AVUTIL_ROOT})
	find_library(AVUTIL_LIBRARIES NAMES avutil avutil.56 PATHS ${AVUTIL_ROOT})
else()
	find_path(AVUTIL_INCLUDE_DIR libavutil/avutil.h)
	find_library(AVUTIL_LIBRARIES NAMES avutil avutil.56)
endif()

if(AVUTIL_INCLUDE_DIR AND AVUTIL_LIBRARIES)
	set(AVUTIL_FOUND ON)
endif()

if(AVUTIL_FOUND)
	if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
		MESSAGE(STATUS "Found ${CMAKE_FIND_PACKAGE_NAME} include:  ${AVUTIL_INCLUDE_DIR}")
		MESSAGE(STATUS "Found ${CMAKE_FIND_PACKAGE_NAME} library: ${AVUTIL_LIBRARIES}")
	endif()
else()
	if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
		MESSAGE(FATAL_ERROR "Could NOT find ${CMAKE_FIND_PACKAGE_NAME} development files")
	endif()
endif()