[vtk-developers] Wrapping vtkConfigure.h, vtkType.h, etc.

David Gobbi david.gobbi at gmail.com
Tue Aug 17 13:42:09 EDT 2010


For wrapping VTK constants, I've created an optional variable for the
kits, e.g. in Common/CMakeLists.txt:

SET(Kit_WRAP_HEADERS
  vtkSystemIncludes.h
  vtkType.h
  ${VTK_BINARY_DIR}/vtkConfigure.h
  )

This tells the python wrappers to wrap these headers
(Filtering/vtkCellType.h is also wrapped).  Since the constants are
wrapped directly into the kit python modules, vtkConstants.py is
obsolete.

  David


On Mon, Aug 16, 2010 at 11:45 AM, David Gobbi <david.gobbi at gmail.com> wrote:
> Hi All,
>
> I'm looking for the best way to modify the VTK cmake scripts so that I
> can automatically wrap constants like VTK_POLY_DATA.  Right now, some
> of these constants are hard-coded in e.g. vtkConstants.py but of the
> wrapper's "hard-coded" copies of the constants are never up to date.
> The only thing that is needed to python-wrap these constants is to
> pass the header files vtkConfigure.h, vtkType.h, etc. to
> vtkWrapPython. One way to do this is to add these headers to the
> source list:
>
> Set(Kit_SRCS vtkType.h ...)
> SET_SOURCE_FILES_PROPERTIES(vtkType.h HEADER_FILE_ONLY)
>
> However, I'm reluctant do to this because no other VTK header files
> are handled this way.  The alternative is to make a separate list for
> header files, one that will be used by KitCommonPythonWrapBlock.cmake:
>
> Set(Kit_HDRS vtkType.h ...)
>
> And then in KitCommonPythonWrapBlock.cmake:
> SET(FILES_TO_WRAP ${Kit_SRCS} ${Kit_HDRS})
> VTK_WRAP_PYTHON3(vtk${KIT}Python KitPython_SRCS "${FILES_TO_WRAP}")
>
> I'm leaning towards this latter method, because it seems to be the
> tidier of the two approaches.
>
>  David
>



More information about the vtk-developers mailing list