When I use vtk, I use a lot of dlls, I was wondering if there is a way to modify the cmake configuration to implement a single dll.
I tried to retrieve all the cxx files to generate a single library project, but there are a lot of compilation errors, it is difficult to deal with them one by one.
I’ve tried compiling the VTK statically and then dynamically compiling the required interface to the dll, and when I only use vtk, it’s successful. But when I need to work with dynamically compiled QT, it will appear like accessing a null pointer when I run it, or there will be no result when I run it.
You can reduce the number of DLLs with the VTK_ENABLE_KITS option. There was discussion about making a single “mega kit” library but it never materialized.
Thank you very much for your suggestion. I have tested this approach, and under the release configuration, the number of DLLs has decreased from 160 to 80.
This is a significant improvement. I will continue to explore the CMake configuration to see if further streamlining is possible.
I would start by setting modules that you don’t need with -DVTK_MODULE_ENABLE_VTK_XYZ=DONT_WANT. That will make it not build if nothing else requires it but not block something needing it from turning it on.
That’s good advice, I’ll check it out.
However, the exe I generated required more than half of the DLLs to be called, which was still more than I expected.