[vtkusers] How should one build a Custom VTK module library

Kamyar kgh5 at raymak.com
Mon Aug 6 13:42:04 EDT 2018


I have a couple of custom VTK filters. They are hacked into the VTK
sources by adding them to the CMakeList of the existing General Filters
module and built along with the entire VTK library. I use the resulting
filters both in Paraview (shared libs), and in a little executable
(static libs). 

I assume I should be able to make VTK as is, then build my filters
separately into a new library. But I can't figure out how to set up the
CMakelist so the library can be built separately. Every example I can
find for custom VTK filters builds them directly into an executable, not
a library. 

Am I supposed to be doing this as a VTK Remote Module? But there is
nothing published in a journal, and I am not trying to share it with
anyone. 

Am I supposed to put them in as a Third-party submodule? But then they
would still build along with the full VTK build. 

Here is the attempted CMakeList, which produces the error: "Unknown
CMake command "vtk_module_library".

> find_package(VTK REQUIRED)
> include(${VTK_USE_FILE})
> 
> set(Module_SRCS
> ModelReduce.cxx
> ) 
> 
> configure_file(
> ${CMAKE_CURRENT_SOURCE_DIR}/ModelReduceExport.h.in
> ${CMAKE_CURRENT_BINARY_DIR}/ModelReduceExport.h
> ) 
> 
> vtk_module_library(vtkModelReduce ${Module_SRCS})
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180806/4d741524/attachment.html>


More information about the vtkusers mailing list