用到的cmake
1. CheckCxxCompilerFlag 模块
检查cxx编译器是否支持某个flag
include(CheckCxxCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++1" COMPILER_SUPPORTS_CXX11)
if (COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++1")
else()
message(FATAL "not support c++11.")
endif()