CMake: fix build with dependency to libav

Check if FFmpeg or libav dependency, and define variable to manage
includes in source code.