Fixes for CCache, grouped static linking, and OpenGL detection.

- Add CCache/CMake fix for setting CCACHE_BASEDIR to CMAKE_CURRENT_SOURCEDIR in the compilation line.
- Add --start-group ... --end-group around the linked libraries for GNU-style linkers, in order to get rid of the library order, useful when linking statically.
- Fix OpenGL detection by requiring a check every time and providing nvidia path suffix to lookup path.