[vtk-developers] PythonCore module removal

David Gobbi david.gobbi at gmail.com
Thu Jun 14 10:54:57 EDT 2012


On Thu, Jun 14, 2012 at 7:30 AM, David Lonie <david.lonie at kitware.com> wrote:
> Hi David,
>
> On Tue, Jun 12, 2012 at 3:34 PM, David Gobbi <david.gobbi at gmail.com> wrote:
>> This just depends on python, right?  Not the python wrappers?
>> So it could do its own find_package(PythonLibs REQUIRED)
>> and set up the include_directories and link_libraries, completely
>> independent of the wrappers.  I'm not saying it would be easy...
>> some important things like the generation of vtkPythonConfigure.h
>> and choosing between the release & debug versions of the python
>> library are tied up with wrapping and would need to be refactored.
>
> Right, this doesn't need access to any of the wrapping code, just
> python. I wanted to see if it made sense to split out the PythonCore
> module as something that could be shared between VTK modules and the
> wrapping code. I noticed that quite a bit of setup is done in the
> PythonCore headers, as you mention, and I'd like to avoid having to
> replicate/maintain this in another spot. Could this split be easily
> done? Or is most of the setup in vtkPython.h et al. legacy code that
> wouldn't be needed?

The setup in vtkPython.h isn't legacy, it's still necessary.  But there is
no reason for vtkPython.h to include vtkPythonCoreModule.h (which
contains the export macros).  If this header is removed from vtkPython.h,
then vtkPython.h can go anywhere.

It might make sense to merge vtkPython.h and vtkPythonConfigure.h into
one file and move them into Common/Core/vtkPython.h.in, i.e. a single,
configured header file that is created whenever Python is found.

There is also a bunch of python debug library setup that is currently in
CMake/vtkWrapPython.cmake that would have to be moved into a
separate .cmake file.

 - David



More information about the vtk-developers mailing list