Hi,

I wanted to setup a project that built VTK libraries using the modern vtk
module cmake code, added Python wrapping to the VTK libraries, and then
built a ParaView plugin that linked against the VTK libraries.

Traditionally, a ParaView plugin is created by compiling all the cxx files
into the plugin library, but I wanted my files compiled into a standard VTK
module library, and I wanted Python wrappers so that I could import my vtk
module library in Python.

Here's the example project.

https://github.com/patmarion/PythonWrappedPluginExample


It works, I tested it on ParaView master, but I had to comment out some
lines in ParaViewPlugins.cmake to avoid configure errors.  If a someone who
knows the pv_setup_module_environment() macro wants to give this a shot and
see why it doesn't work, please let me know!  *It seems that
pv_setup_module_environment() is broken:*

CMake Error at ParaView/VTK/CMake/vtkModuleAPI.cmake:44 (message):
  No such module: "AutobahnPython"
Call Stack (most recent call first):
  ParaView/CMake/ParaViewPlugins.cmake:1300 (vtk_module_load)
  Module/CMakeLists.txt:2 (pv_setup_module_environment)


I had to comment out a foreach loop to make it configure:

diff --git a/CMake/ParaViewPlugins.cmake b/CMake/ParaViewPlugins.cmake
index dcf53f9..12b139e 100644
--- a/CMake/ParaViewPlugins.cmake
+++ b/CMake/ParaViewPlugins.cmake
@@ -1296,7 +1296,8 @@ macro(pv_setup_module_environment _name)
   include(vtkModuleAPI)
   include(vtkClientServerWrapping)
   # load information about existing modules.
-  foreach (mod IN LISTS VTK_MODULES_ENABLED)
-    vtk_module_load("${mod}")
-  endforeach()
+  #foreach (mod IN LISTS VTK_MODULES_ENABLED)
+  #  vtk_module_load("${mod}")
+  #  endif()
+  #endforeach()
 endmacro()


Pat
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to