Fixed cmake bugs that cause errors on systems without flycap