[Paraview-developers] Paraview Plugin Python wrapped

Cory Quammen cory.quammen at kitware.com
Thu Jun 29 09:15:42 EDT 2017


> https://www.paraview.org/pipermail/paraview/2012-May/024855.html
>
> I tried following this example but it isn’t working. Wrap-python.cmake
> doesn’t exist in the current version of ParaView.

wrap-python.cmake does not come with ParaView - it's content is
defined in Pat's email you cited:

# wrap-python.cmake
if(NOT DEFINED VTK_CMAKE_DIR)
  message(SEND_ERROR "VTK_CMAKE_DIR is not defined, cannot load
vtkWrapPython.cmake")
endif()

if(NOT VTK_WRAP_PYTHON)
  message(FATAL_ERROR "VTK was built without Python enabled
(VTK_WRAP_PYTHON=FALSE).")
endif()

include(${VTK_CMAKE_DIR}/vtkWrapPython.cmake)
function(wrap_python library_name sources)
  vtk_wrap_python3(${library_name}Python generated_python_sources
"${sources}")
  add_library(${library_name}PythonD ${generated_python_sources})
  add_library(${library_name}Python MODULE ${library_name}PythonInit.cxx)
  target_link_libraries(${library_name}PythonD ${library_name})
  foreach(c ${VTK_LIBRARIES})
    target_link_libraries(${library_name}PythonD ${c}PythonD)
  endforeach(c)
  target_link_libraries(${library_name}Python ${library_name}PythonD)
  set_target_properties(${library_name}Python PROPERTIES PREFIX "")
  if(WIN32 AND NOT CYGWIN)
    set_target_properties(${library_name}Python PROPERTIES SUFFIX ".pyd")
  endif(WIN32 AND NOT CYGWIN)
endfunction()

I'm not sure if this will work, but I just wanted to clarify where
wrap-python.cmake is defined.

HTH,
Cory

>
>
> I found this macro “WRAP_PLUGIN_FOR_PYTHON”
>
> https://github.com/Kitware/ParaView/blob/master/CMake/ParaViewPlugins.cmake
>
> Using this macro, I’m getting a error “unknown cmake command
> Python_add_module”.
>
>
>
> I am compiling my custom plugin inside ParaView’s plugin folder
>
>
>
>
>
> Am I supposed to used this in my plugin cmakelist file to enable the python
> wrapping or is there another setting to activate ?
>
>
>
> Thank you
>
> Michal
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at:
> http://markmail.org/search/?q=Paraview-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview-developers
>



-- 
Cory Quammen
Staff R&D Engineer
Kitware, Inc.


More information about the Paraview-developers mailing list