[vtkusers] Python wrapping example won't build on Mac OS X

Martin Costabel costabel at wanadoo.fr
Sat Mar 13 03:22:30 EST 2004


Theodore D. Sternberg wrote:
> The VTK 4.4 source code ships with a small example (in
> Examples/Build/vtkLocal) of how to add classes to VTK and get them wrapped
> for use from Tcl and Python.  It all builds and works wonderfully on
> Linux, but on Mac OS X there are several problems:

 From looking at cvs logs, it seems to me that the vtkLocal example (and 
the other Examples) come from older archeological strata, below the 
great fix for Python on Mac OS X on 28 Aug 2003. The 
Examples/Build/vtkLocal/CMakeLists.txt just has the 2 lines

     ADD_LIBRARY(${PROJECT_NAME}Python MODULE ${vtkLocalPYTHON_SRCS})
     TARGET_LINK_LIBRARIES(${PROJECT_NAME}Python vtkCommonPython 
${PROJECT_NAME})

where more recent CMakeLists.txt files have a special treatment for 
APPLE. From Common/CMakeLists.txt:

   IF (APPLE)
     ADD_LIBRARY(vtk${KIT}PythonD ${KitPython_SRCS} 
${Kit_PYTHON_EXTRA_SRCS})
     ADD_LIBRARY(vtk${KIT}Python MODULE vtk${KIT}PythonInit.cxx)
     TARGET_LINK_LIBRARIES(vtk${KIT}PythonD vtk${KIT} ${KIT_PYTHON_LIBS} 
${PYTHON_LIBRARY})
     TARGET_LINK_LIBRARIES(vtk${KIT}Python vtk${KIT}PythonD)
     INSTALL_TARGETS(/lib/vtk vtk${KIT}PythonD)
   ELSE (APPLE)
     ADD_LIBRARY(vtk${KIT}Python MODULE ${KitPython_SRCS} 
${Kit_PYTHON_EXTRA_SRCS})
     TARGET_LINK_LIBRARIES (vtk${KIT}Python vtk${KIT} ${KIT_PYTHON_LIBS})
   ENDIF(APPLE)

Did you try to change the vtkLocal/CMakeLists.txt analogously?

-- 
Martin



More information about the vtkusers mailing list