I have updated the gist today. The CMakeLists.txt now provides ENABLE_XXX=ON/OFF options that match the gentoo use flags, except for FFMPEG. I have also fixed the RelWithDebInfo build type, and added an option to build the shared and static libraries.
Morgan: could you maybe check if it now integrates well with the gentoo build system?
I have included the first modification, but not the second one, because I want to find a better solution. Cmake complains that there is a trailing space in the library list, but at least on my system(s) it proceeds anyhow with the compilation...
@darix: did you already have a chance to give the cmake configuration a try?