Cleaning up the CMakeLists.txt a little
Add checks for OpenGL errors