This monumental hack here, can we make sure that it only runs in your build instead of everywhere?

I suggest you do:

OPTION(ENABLE_UBUNTU_FFMPEG_HACK "hacky stuff" OFF)
if(ENABLE_UBUNTU_FFMPEG_HACK)
 ... install ...
endif(ENABLE_UBUNTU_FFMPEG_HACK)