This will do it:<br><br># CMakeLists.txt<br><br>include(wrap-python.cmake)<br><br>add_paraview_plugin(${library_name} ...)<br>target_link_libraries(${library_name} ${deps})<br><br>if(VTK_WRAP_PYTHON)<br> wrap_python(${library_name} "${sources}")<br>
endif()<br><br><br><br><br># wrap-python.cmake<br>if(NOT DEFINED VTK_CMAKE_DIR)<br> message(SEND_ERROR "VTK_CMAKE_DIR is not defined, cannot load vtkWrapPython.cmake")<br>endif()<br><br>if(NOT VTK_WRAP_PYTHON)<br>
message(FATAL_ERROR "VTK was built without Python enabled (VTK_WRAP_PYTHON=FALSE).")<br>endif()<br><br>include(${VTK_CMAKE_DIR}/vtkWrapPython.cmake)<br>function(wrap_python library_name sources)<br> vtk_wrap_python3(${library_name}Python generated_python_sources "${sources}")<br>
add_library(${library_name}PythonD ${generated_python_sources})<br> add_library(${library_name}Python MODULE ${library_name}PythonInit.cxx)<br> target_link_libraries(${library_name}PythonD ${library_name})<br> foreach(c ${VTK_LIBRARIES})<br>
target_link_libraries(${library_name}PythonD ${c}PythonD)<br> endforeach(c)<br> target_link_libraries(${library_name}Python ${library_name}PythonD)<br> set_target_properties(${library_name}Python PROPERTIES PREFIX "")<br>
if(WIN32 AND NOT CYGWIN)<br> set_target_properties(${library_name}Python PROPERTIES SUFFIX ".pyd")<br> endif(WIN32 AND NOT CYGWIN)<br>endfunction()<br><br><br><br>Pat<br><br><br><div class="gmail_quote">On Wed, May 2, 2012 at 11:56 AM, Sebastien Jourdain <span dir="ltr"><<a href="mailto:sebastien.jourdain@kitware.com" target="_blank">sebastien.jourdain@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Paul,<br>
<br>
it is not a CMake option but a CMake macro/function that need to be<br>
called inside your Plugin CMake file... But I have no clue how, has I<br>
took another path when I solved that exact same problem.<br>
In my case, I simply extended ParaView itself instead of relying on a plugin...<br>
<br>
Seb<br>
<div class="HOEnZb"><div class="h5"><br>
On Wed, May 2, 2012 at 11:49 AM, Paul Edwards <<a href="mailto:paul.m.edwards@gmail.com">paul.m.edwards@gmail.com</a>> wrote:<br>
> I'm actually wanting the VTK classes rather than the proxy.<br>
><br>
> Sebastian: are you referring to the VTK_WRAP_PYTHON_SIP option? I don't<br>
> have that enabled atm but could try...<br>
><br>
> Thanks,<br>
> Paul<br>
><br>
><br>
> On 2 May 2012 16:43, Andy Bauer <<a href="mailto:andy.bauer@kitware.com">andy.bauer@kitware.com</a>> wrote:<br>
>><br>
>> I'm not sure this is what you're looking for but the proxy does get<br>
>> wrapped such that it's available through pvpython and pvbatch. When you<br>
>> load the plugin, do "LoadPlugin("<shared lib location>", True, globals())"<br>
>> and it should be available. If you're want the actual VTK class to by<br>
>> python wrapped, I think Sebastien is correct though.<br>
>><br>
>> Andy<br>
>><br>
>><br>
>> On Wed, May 2, 2012 at 11:32 AM, Sebastien Jourdain<br>
>> <<a href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>> wrote:<br>
>>><br>
>>> Hi Paul,<br>
>>><br>
>>> your vtk class are not "python" wrapped automatically when provided<br>
>>> from plugin. But you might be able to use a CMake macro that has been<br>
>>> defined in ParaView to force your vtk classes to be Python wrapped.<br>
>>> Although, I'm not fully certain that will just work.<br>
>>> Unfortunately I don't have much insight on where to look.<br>
>>><br>
>>> Dave DeMarle might be able to point you to the right direction...<br>
>>><br>
>>> Seb<br>
>>><br>
>>> On Wed, May 2, 2012 at 10:56 AM, Paul Edwards <<a href="mailto:paul.m.edwards@gmail.com">paul.m.edwards@gmail.com</a>><br>
>>> wrote:<br>
>>> > Hi,<br>
>>> ><br>
>>> > Do my VTK classes get wrapped when I create a paraview plugin? If so,<br>
>>> > how<br>
>>> > do I access them? And, if not, is it possible to do this?<br>
>>> ><br>
>>> > Thanks,<br>
>>> > Paul<br>
>>> ><br>
>>> > _______________________________________________<br>
>>> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>>> ><br>
>>> > Visit other Kitware open-source projects at<br>
>>> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>>> ><br>
>>> > Please keep messages on-topic and check the ParaView Wiki at:<br>
>>> > <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
>>> ><br>
>>> > Follow this link to subscribe/unsubscribe:<br>
>>> > <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
>>> ><br>
>>> _______________________________________________<br>
>>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>>><br>
>>> Visit other Kitware open-source projects at<br>
>>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>>><br>
>>> Please keep messages on-topic and check the ParaView Wiki at:<br>
>>> <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
>>><br>
>>> Follow this link to subscribe/unsubscribe:<br>
>>> <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
>><br>
>><br>
><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
</div></div></blockquote></div><br>