Right after you started this topic I installed the same CMake version and tried recompiling tgui.
I didn't have any problems, so if reinstalling doesn't work then I have absolutely no idea what could be causing this.
Are you able to compile sfml, or is this only a problem with tgui?