How does one find and use VTK in CMake with 9.0.0. I’m using find_package(VTK REQUIRED …), and it’s seems happy, although the only output appears to be finding X11 and Xt. All the documentation that I can find is conflicting, and appears to be outdated.
I would appreciate it if someone could point me to up-to-date documentation or an example. I just need to know what variable to use to get the include/library paths, and libraries.
Great timing. I just wrote up this document which details how to do it. Do you have any feedback on what else could go into it before it gets merged (it’ll be in 9.0.1)? It looks a bit weird and links are broken because it’s actually a Doxygen input (where it will ultimately end up).
I know the wiki is out-of-date; it needs a sweep to put banners about that and the still-pertinent information migrated into the repository.
Using ${VTK_LIBRARIES} instead means that needscore all of a sudden ends up needing X, OpenGL, Cocoa, etc. (depending on the platform). Explicit usage is recommended so that you don’t end up adding extra links if you have another VTK-using target that needs a new component (“explicit is better than implicit”).
@ben.boeckel Should a mention also be made about VTK/Utilities/Maintenance/FindNeededModules.py? This is definitely useful for determining what modules your code needs in the new system.