# Autoloading VTKPythonAlgorithmBase plugins with CMake

**URL:** https://discourse.paraview.org/t/autoloading-vtkpythonalgorithmbase-plugins-with-cmake/1861
**Category:** Development
**Tags:** python
**Created:** [May 15, 2019, 3:31pm UTC](https://discourse.paraview.org/t/autoloading-vtkpythonalgorithmbase-plugins-with-cmake/1861 "2019-05-15T15:31:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![phil\_ossk](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/858c86/32.png) [@phil\_ossk](https://discourse.paraview.org/u/phil_ossk)
#### Post date: [May 15, 2019, 3:31pm UTC](https://discourse.paraview.org/t/autoloading-vtkpythonalgorithmbase-plugins-with-cmake/1861/1 "2019-05-15T15:31:51Z")

</div>

Hello there,

I have a couple plugins that I developed using the VTKPythonAlgorithmBase class.  
I would like them to be built along with my main project so that they would be loaded automatically after a fresh install. So manually loading the .py files and clicking auto-load is not an option.  
I cannot find any example of implementation and my attempts have failed.

Let’s consider the PythonAlgorithmExamples.py file that is included in paraview  
( [ParaView](https://github.com/Kitware/ParaView)/[Examples](https://github.com/Kitware/ParaView/tree/master/Examples)/[Plugins](https://github.com/Kitware/ParaView/tree/master/Examples/Plugins)/[PythonAlgorithm](https://github.com/Kitware/ParaView/tree/master/Examples/Plugins/PythonAlgorithm)/ **PythonAlgorithmExamples.py** )

I wrote both a CMakeLists.txt and a plugin.cmake for it, and so far, I am able to see that plugin in the plugin list. It is shown as being loaded, and the “Auto Load” line has the checkmark but I can’t instantiate the plugin in paraview.

I expect to be able to create a “Python-based Superquadric Source Example” like when I load the file manually but I can’t.

My CMakeLists.txt

> INCLUDE\_DIRECTORIES(  
> ${VTK\_INCLUDE\_DIRS}  
> )
> 
> ADD\_PARAVIEW\_PLUGIN(PyAlg “1.0”  
> PYTHON\_MODULES PythonAlgorithmExamples.py  
> )

My plugin.cmake

> pv\_plugin(PyAlg  
> DESCRIPTION “PyAlg”  
> DEFAULT\_ENABLED  
> AUTOLOAD  
> )

Any clues?  
Thank you very much
