# 相关链接:https://cmake.org/cmake/help/v3.0/module/CheckCXXCompilerFlag.html
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
if(COMPILER_SUPPORTS_CXX11)
add_definitions("-std=c++11")
endif()
C++代码中则可以如下判断:
#if __cplusplus >= 201103L
#include
#endif // __cplusplus >= 201103L