CMake is a meta programming language designed to compile into Makefiles.
It can compile into visual studio projects or xcode projects. That's how it achieves multiplatform support.
Basically by writing it in CMake rather then make you've automatically written your make file as well as many other platform configurations. Of course the caveat like the OP is that CMake syntax and design decisions are just plain bad.