Well well well, we finally found something CMake can actually do. Please, everyone, stop using CMake. It doesn't do its one job.
I'll agree CMake is pretty rough to get into, but what makes you say it doesn't do it's one job?
It doesn't log what it attempted, or why it failed.
It can't find out how to link binaries (always awesome to set up som execsnoop (because no logs, remember) only to see that it tries to link with "-llibfoo". In what world could that be correct?. And again it doesn't log how and why it chose that)
I could go on, but it's too much for a comment field.