为 iOS 编译 VTK 时缺少 OpenGL 扩展项

Missing OpenGL extension items when compiling VTK for iOS

我正在尝试按照 https://blog.kitware.com/building-vtk-for-mobile-architectures/ 上的说明为 iOS 编译 VTK 7.1.0。

我发现了以下问题:

 [ 90%] Built target vtkglew [ 90%] Building CXX object
 Rendering/OpenGL2/CMakeFiles/vtkRenderingOpenGL2.dir/vtkOpenGLPolyDataMapper.cxx.o

/Users/nclex/Documents/dev/VTK/VTK-7.1.0/Rendering/OpenGL2/vtkOpenGLPolyDataMapper.cxx:1582:36: error: 

      use of undeclared identifier 'GL_MULTISAMPLE'

  bool multisampling = glIsEnabled(GL_MULTISAMPLE) == GL_TRUE;

GL_MULTISAMPLE 在 glew.h 中定义,它是源代码树的一部分,但不确定为什么在编译期间看不到它。

我在 MacOS 10.12.1 (Sierra) 上使用 Xcode 8.1。 VTK 代码是位于 http://www.vtk.org/download/.

的 7.1.0 link

vtkOpenGLPolyDataMapper.cxx中似乎有一些错误。

为了修复编译问题,我替换了:

#if GL_ES_VERSION_3_0 != 1
  bool multisampling = glIsEnabled(GL_MULTISAMPLE) == GL_TRUE;
#else
  bool multisample = false;
#endif

#if GL_ES_VERSION_3_0 != 1 && defined GL_MULTISAMPLE
  bool multisampling = glIsEnabled(GL_MULTISAMPLE) == GL_TRUE;
#else
  bool multisampling = false;
#endif

更新 git 存储库在同一天更新了修复程序。 这个项目的 repo 似乎没有很好地策划(或者至少,拉取请求在合并之前没有全面测试)。