在CMake中设置编译器警告级别 传统的方法 现代CMake Modern CMake 应用到所有目标 注意 传统的方法 if(MSVC) # Force to always compile with W4 if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") string(