Select correct -std flag for CMake for different versions of gcc.