Improved the CMake check for C++11 support.