What you did sounds reasonable to me. Since you're branded application is fairly customized, what you did makes sense. For simpler customizations, one could also set PARAVIEW_EXTERNAL_PLUGIN_DIRS to include directories from which ParaView should bring in extra plugins. Those will then be included in the default .plugins file automatically.<div class="gmail_extra">
<br><br><div class="gmail_quote">On Thu, Nov 15, 2012 at 3:20 PM, Cory Quammen <span dir="ltr"><<a href="mailto:cquammen@cs.unc.edu" target="_blank">cquammen@cs.unc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Utkarsh,<br>
<br>
I just got everything to compile against ParaView 3.98.0-RC2 and<br>
pushed my changes to github:<br>
<br>
<a href="https://github.com/MADAI/MADAIWorkbench" target="_blank">https://github.com/MADAI/MADAIWorkbench</a><br>
<br>
In fact, in the current state of things, it turns out I can use<br>
pv_plugin() and its AUTOLOAD option.<br>
<br>
Briefly, here are the changes I had to make. Feel free to use this as<br>
a basis for an entry in the future migration guide if you wish.<br>
<br>
- Remove the inclusion of my Plugins directory via add_subdirectory.<br>
The CMake macro pv_process_plugins() will add the Plugin directory as<br>
well as the directories for all your plugins.<br>
<br>
- Remove the CMakeLists.txt file in my Plugins directory because it is<br>
no longer needed to list all the plugin subdirectories.<br>
<br>
- Add a plugin.cmake file to each plugin directory with an entry like<br>
<br>
pv_plugin( BinningFilter<br>
DESCRIPTION "Filter that discretizes points into a grid"<br>
DEFAULT_ENABLED<br>
AUTOLOAD<br>
)<br>
<br>
Note that if you forget to add DEFAULT_ENABLED prior to configuring<br>
the project for the first time, the plugin will be disabled and you<br>
will need to either enable it through CMake by setting<br>
PARAVIEW_BUILD_PLUGIN_BinningFilter to ON or wiping out your build<br>
directory and configuring again with CMake.<br>
<br>
I want all the plugins to load at program startup, so I add AUTOLOAD<br>
to each pv_plugin call. This mechanism works as expected.<br>
<br>
- Remove AUTOLOAD from calls to add_paraview_plugin()<br>
<br>
- In the CMakeLists.txt file for your application, call<br>
pv_process_plugins(), passing the source and binary plugin directories<br>
as arguments.<br>
<br>
All in all, the changes weren't that substantial.<br>
<span class="HOEnZb"><font color="#888888"><br>
Cory<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Thu, Nov 15, 2012 at 1:26 PM, Cory Quammen <<a href="mailto:cquammen@cs.unc.edu">cquammen@cs.unc.edu</a>> wrote:<br>
> Utkarsh,<br>
><br>
> On Thu, Nov 15, 2012 at 12:16 PM, Utkarsh Ayachit<br>
> <<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>> wrote:<br>
>> Cory,<br>
>><br>
>>> I have at least one plugin packaged with our branded version of<br>
>>> ParaView where the AUTOLOAD mechanism is used. For that plugin, I<br>
>>> don't want to rely on the user checking the box in the GUI. So I think<br>
>>> the option is still useful.<br>
>>><br>
>><br>
>> Hmm, okay. I have been wondering what support could we provide to ensure<br>
>> that plugins for branded applications can be loaded automatically. Can you<br>
>> give some more details on who your application is setup, maybe we can come<br>
>> up with something cleaner.<br>
><br>
> I had been relying on the .plugins file that I was able to write with<br>
> a macro (or function) called write_plugins_file() that is no longer in<br>
> ParaView master. I think the .plugins file is now written by<br>
> pv_process_plugins. Including the .plugins file in my installer was<br>
> all I needed to get the autoload plugin to work.<br>
><br>
>> When you generate binaries for your users, do you<br>
>> package your plugin's shared libraries with the application as well (similar<br>
>> to what ParaView does for plugins in the ParaView source)?<br>
><br>
> Yes, it is a self-contained installer with the branded application and<br>
> all plugins. You can take a look at the CMakeLists.txt file with most<br>
> of the packaging stuff here if you are curious:<br>
><br>
> <a href="https://github.com/MADAI/MADAIWorkbench/blob/master/Application/CMakeLists.txt" target="_blank">https://github.com/MADAI/MADAIWorkbench/blob/master/Application/CMakeLists.txt</a><br>
><br>
> It's a bit of a hack job, but it works for Mac and Windows. Look<br>
> around line 160 for the plugin-specific stuff. Note that this compiles<br>
> against ParaView 3.14.1 and won't configure yet with 3.98-RC2 (I'm<br>
> working on it).<br>
><br>
> Thanks for you time and interest,<br>
><br>
> Cory<br>
><br>
> --<br>
> Cory Quammen<br>
> Research Associate<br>
> Department of Computer Science<br>
> The University of North Carolina at Chapel Hill<br>
<br>
<br>
<br>
--<br>
Cory Quammen<br>
Research Associate<br>
Department of Computer Science<br>
The University of North Carolina at Chapel Hill<br>
</div></div></blockquote></div><br></div>