CMake C++11设置
发布日期:2021-10-16 03:16:08 浏览次数:0 分类:技术文章
if(CMAKE_VERSION VERSION_LESS 3.0.0)    include(CheckCXXCompilerFlag)    check_cxx_compiler_flag(-std=c++11 COMPILER_SUPPORTS_CXX11)    check_cxx_compiler_flag(-std=c++0x COMPILER_SUPPORTS_CXX0X)    if(COMPILER_SUPPORTS_CXX11)      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")    elseif(COMPILER_SUPPORTS_CXX0X)      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")    endif()else()    SET(CMAKE_CXX_STANDARD 11)    SET(CMAKE_CXX_STANDARD_REQUIRED ON)endif()
上一篇:共享库中单例的多个实例
下一篇:cmake设置启动项