CMake tweaks for correct project types

Also corrects problems with compiler checks