CMakeList.txt中添加:(這裏加在了project(VTK)之後)
if (MSVC_VERSION GREATER_EQUAL "1900")
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("/std:c++17" _compiler_supports_cxx17)
if (_compiler_supports_cxx17)
add_compile_options("/std:c++17")
endif()
endif()