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

Robert Maynard robert.maynard at kitware.com
Mon Aug 6 15:32:34 EDT 2018


You will need to include the vtkExternalModuleMacros.cmake file for
this approach to work. Something like the following should allow
vtk_module_library to be a valid command:

set(CMAKE_MODULE_PATH
    ${CMAKE_MODULE_PATH}
    ${VTK_CMAKE_DIR}
    ${CMAKE_CURRENT_SOURCE_DIR}/cmake
    )
include(vtkExternalModuleMacros)
On Mon, Aug 6, 2018 at 1:42 PM Kamyar <kgh5 at raymak.com> wrote:
>
> 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})
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/vtkusers


More information about the vtkusers mailing list