Building VTK from Source with Modules

I’m trying to build VTK from the source on Windows with three modules enabled. I got the source from here and I’m enabling VTK::RenderingOpenGL2, VTK::RenderingOpenVR, and VTK::RenderingOpenXR.

The building process I followed used these commands:


This configures the project and after this, I simply run:

cmake --build build

After about 40 or so minutes, the build completes, however, inside build\lib\Debug I don’t see any library from either of these modules. For example, for OpenGL, I was expecting vtkRenderingContextOpenGL2-9.3d.lib.

What is the problem here?

Are you building on Windows ?

Does ... Works on windows ?

Please share the complete compilation output.

I’m building on Windows. Sorry, I should have mentioned that I put the correct paths in the real command. Here, I have placed ... for convenience. Compilation works successfully, however, .lib files for OpenGL, OpenVR, and OpenXR are not generated under the lib folder inside the build folder.

Please share the recursive content of lib and bin directory.

lib tree: lib tree -
bin tree: bin tree -

Looks fine on my own build.

Please start from scratch and share the output of the cmake configuration of VTK.

Here is the log of configuring the build with CMake: configlog.txt -

I built it again after this and the same issue is happening.

try with -DVTK_MODULE_ENABLE_VTK_RenderingOpenGL2=YES ?

Same issue. What could be causing the build to not generate libraries for OpenGL, OpenVR, and OpenXR even though the configuration happens correctly (I believe according to the logs I shared)?

I’m afraid I have no idea. It is working well here. Maybe try with ninja instead of visual studio ?

Using the Ninja generator is definitely recommended. You can also debug the module system with -DVTK_DEBUG_MODULE=ON -DVTK_DEBUG_MODULE_ALL=ON.

Note that the VS build may have a slight non-standard layout in the build tree. However, I see their -hierarchy.txt files, so they are enabled. Did the build complete successfully? It seems that there’s probably a build failure somewhere.