if(SWSCALE_INCLUDE_DIR AND SWSCALE_LIBRARIES)
	unset(SWSCALE_INCLUDE_DIR)
	unset(SWSCALE_LIBRARIES)
endif()

if (SWSCALE_ROOT)
	find_path(SWSCALE_INCLUDE_DIR libswscale/swscale.h PATHS ${SWSCALE_ROOT})
	find_library(SWSCALE_LIBRARIES NAMES swscale swscale.5 PATHS ${SWSCALE_ROOT})
else()
	find_path(SWSCALE_INCLUDE_DIR libswscale/swscale.h)
	find_library(SWSCALE_LIBRARIES NAMES swscale swscale.5)
endif()

if(SWSCALE_INCLUDE_DIR AND SWSCALE_LIBRARIES)
	set(SWSCALE_FOUND ON)
endif()

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