Use external lib in vkt filter

Hi all,
I’va created a C++ ParaView plugin containing a vtk filter. This filter uses (includes) a library (as a git submodule).

In the CMakeLists.txt, I’ve added the directory of the library (with the add_subdirectory command, the library .so is generated) and the include directories so that the filter and plugin compile.

However the filter library ( is not linked to to that library. I have an undefined symbol when I try to execute the filter in ParaView (the plugin is loaded without error), and the library does not appear in the dependencies when I use the ldd command.

I tried to add a target_link_library in various places, but it never seems to work. I have the following messages:
The keyword signature for target_link_libraries has already been used with
the target “XXXFilter”. All uses of target_link_libraries with a target
must be either all-keyword or all-plain.
Failed to find the required module XXX (name of my library)

Any idea about what I need to do to make it work? Or any example of vtk filters using libraries?



you can find an example in Plugins/GmshReader

1 Like

Thank you so much! I was just missing the vtk_module_link

1 Like