I’ve read the instructions on building vtk.framework for IOS and am able to do that. However, whenever I try to build the sample applications, I quickly get stuck on things like:
vtkRenderingOpenGL2ObjectFactory.h. (missing file)
or identifiers like vtkRenderingOpenGL2ObjectFactory not being found.
Following a post, I did this to build:
cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_FRAMEWORK_INSTALL_PREFIX=/Users/deb/frameworks -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DVTK_IOS_BUILD=ON -DModule_vtkFiltersModeling=ON …/source
Yes, it should be possible to build. Pass -DVTK_OPENGL_USE_GLES=ON when configuring VTK. It should automatically happen, looks like this is not the case right now.
I was asking the wrong question as it turns out. Building the vtk framework for iOS wasn’t really the issue; the problem is trying to compile the sample program VTKViewer which is included as an example program. And quite possibly VTK_OPENGL_USE_GLES=on is happening. Because like I said it’s not an issue with the framework: it is the sample programs which are hardcoded to use OpenGL2, I guess?
For example, in VTKViewer/VTKView.m, we see the line #include “vtkRenderingOpenGL2ObjectFactory.h”
so it would seem this example program explicitly depends on OpenGL2 as oppposed to OPENGL_GLES.
Same for the VolumeRender example directory: in MyGLKViewController we see:
#include “vtk/vtkRenderingOpenGL2ObjectFactory.h”
It’s great that I can build the VTK framework for iOS; but without an example program (which I seriously doubt I would be able to write on my own), I can’t know that this really still working. Is there any updated iOS example programs somewhere someone could point me to?
All I know is that that include file is just nowhere to be found. Is that generated by the build? Or it an authored source file which should exist somewhere?
OK, well, I’m happy to try any other build flags someone might suggest, not sure what I am missing getting it to build these headers so I can try the examples.
If it helps, I see this in the build directory:
Debonair$ find . -name vtkRenderingOpenGL2ObjectFactory.h
./CMakeExternals/Build/vtk-ios-device-arm64/Rendering/OpenGL2/vtkRenderingOpenGL2ObjectFactory.h
But not in the final framework: find vtk.framework -name vtkRenderingOpenGL2ObjectFactory.h
So it looks like the build created the file, but isn’t putting it in the right (or any, really) location in the final product?
I tried building directly from the fork that has that merge request. That fork doesn’t build for me either. (And what I mean is that the framework builds, but the examples don’t. Once again, vtkRenderingOpenGL2ObjectFactory.h is missing.)
WBN if vtk could work again for iOS. If anyone ever comes back to this thread with an answer, please let me know.