[Paraview] Building plugin with sources in different directory

Stephane PLOIX stephane.ploix at edf.fr
Mon Nov 30 04:54:51 EST 2009


Hi,

You can also look at the way the PointSprite plugin has been structured 
(path_to_paraview_src/Plugins/PointSprite)

In both Rendering and Graphics subdirectory, there is the usual 
CMakeLists.txt that creates a library usable from VTK, and in the 
ParaViewPlugin subdirectory, you have all the ParaView-related stuff.
The main difference are those lines at the end of the Rendering and 
Graphics CmakeLists.txt : 

# 
-----------------------------------------------------------------------------
# This make it easy for other projects to get the list of files etc. in 
this
# kit.
# 
-----------------------------------------------------------------------------
# needed by vtkExportKit.cmake
include(${VTK_CMAKE_DIR}/vtkExportKit.cmake)
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
  STRING(REGEX REPLACE "^/" "" VTK_INSTALL_PACKAGE_DIR_CM24 
"${VTK_INSTALL_PACKAGE_DIR}")
ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)

vtk_export_kit2(
  "CSCS_PointSprite_Rendering" 
  "POINTSPRITE_RENDERING" 
  ${CMAKE_CURRENT_BINARY_DIR} 
  "${KIT_SRCS}"
)

This will create a "Kit" in the binary directory
and in the ParaViewPlugin CmakeLists.txt, you have : 
set(PLUGIN_NAME CSCS_PointSprite_Plugin)

set(CS_WRAP_Rendering)
include(${PointSpritePlugin_BINARY_DIR}/Rendering/vtkCSCS_PointSprite_RenderingKit.cmake)
foreach(class ${VTK_POINTSPRITE_RENDERING_CLASSES})
  set(CS_WRAP_Rendering ${CS_WRAP_Rendering} 
${VTK_POINTSPRITE_RENDERING_HEADER_DIR}/${class}.h)
endforeach(class)

    add_paraview_plugin(${PLUGIN_NAME} "1.0"
      SERVER_MANAGER_SOURCES 
        "${SM_SOURCES};${CS_WRAP_Rendering};${CS_WRAP_Graphics}"
....
)

What this piece of magic does is wrap all the classes in the Rendering and 
Graphics subdirectories in the server-manager laguage, so that you can use 
those classes from proxies, xml and in the paraview python console.

Stephane




jerome.velut at gmail.com 
Envoyé par : paraview-bounces at paraview.org
29/11/2009 21:57

A
pat.marion at kitware.com
cc
paraview at paraview.org
Objet
Re: [Paraview] Building plugin with sources in different directory






Yes, I think this is the cause. Your MyFilter/CMakeLists should define the 
project and different variables such as the include folders. You asked me 
out-of-list for my usual configurations: You may want to take a look at 
http://github.com/jeromevelut/Chiron
This is a work-in-progress Medical Imaging Paraview plugin. Checkout the 
Chiron-PoC branch (proof-of-concept). The structure will not change. In 
your case, your root folder looks like my ./Modules/ folder and your 
./plugin is the same as my ./Plugins

HTH,
Jerome

2009/11/29 pat marion <pat.marion at kitware.com>
Do you need to include_directories(../) ?

Pat


On Sun, Nov 29, 2009 at 12:08 PM, David Doria <daviddoria at gmail.com> 
wrote:
On Sun, Nov 29, 2009 at 11:48 AM, Dave Partyka <dave.partyka at kitware.com> 
wrote:
> Is there a MyPlugin.h file and is it in the same directory as the .cxx? 
If I
> recall correctly the ADD_PARAVIEW_PLUGIN sets up client/server wrappings 
and
> makes an assumption that each source file you give it has a header file.

There is indeed a MyPlugin.h that is in the same directory as
MyPlugin.cxx. What I think the problem is though is the CMakeLists.txt
is not in the same directory as those source files.

The setup is like this
..../MyFilter/MyFilter.cxx
..../MyFilter/MyFilter.h
..../MyFilter/CMakeLists.txt
..../MyFilter/plugin/MyFilter.xml
..../MyFilter/plugin/CMakeLists.txt

The MyFilter CMakeLists SUBDIRS the plugin directory. The
plugin/CMakeLists.txt has

ADD_PARAVIEW_PLUGIN(MyFilter "1.0"
 SERVER_MANAGER_XML MyFilter.xml
SERVER_MANAGER_SOURCES ../MyFilter.cxx
)

I think the problem is that it is looking in ..../MyFilter/plugin for
the .h file. Am I misunderstanding? Is there a way to tell it where to
look (in this case, ../)?

Thanks,

David
_______________________________________________
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


_______________________________________________
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

_______________________________________________
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




Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis à l'intention exclusive des destinataires et les informations qui y figurent sont strictement confidentielles. Toute utilisation de ce Message non conforme à sa destination, toute diffusion ou toute publication totale ou partielle, est interdite sauf autorisation expresse.

Si vous n'êtes pas le destinataire de ce Message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si vous avez reçu ce Message par erreur, merci de le supprimer de votre système, ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support que ce soit. Nous vous remercions également d'en avertir immédiatement l'expéditeur par retour du message.

Il est impossible de garantir que les communications par messagerie électronique arrivent en temps utile, sont sécurisées ou dénuées de toute erreur ou virus.
____________________________________________________

This message and any attachments (the 'Message') are intended solely for the addressees. The information contained in this Message is confidential. Any use of information contained in this Message not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval.

If you are not the addressee, you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return message.

E-mail communication cannot be guaranteed to be timely secure, error or virus-free.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20091130/2b5babaf/attachment-0001.htm>


More information about the ParaView mailing list