Use CMake compiler version flag to set GCC_COMPILER_VERSION variable

Fixes issue [#10353](http://trac.mantidproject.org/mantid/ticket/10353).

To test: Code review the changes to ensure that you agree with them. Run cmake in a clean directory and the correct version of gcc should still be printed out.