Hi Dave, You can reproduce the issue with find_package() calls only, without calling include().
After talking with Utkarsh, it seems the trick is to use the VTKConfig.cmake from the paraview install tree. 2cts On Wed, Sep 7, 2011 at 3:49 PM, David Partyka <[email protected]> wrote: > Right, ParaView's Use file (ParaViewUse.cmake) already calls find VTK > seeding it with PARAVIEW_VTK_DIR. Hence the duplicate targets. > > On Wed, Sep 7, 2011 at 9:36 AM, Utkarsh Ayachit > <[email protected]> wrote: >> >> Mathieu, >> >> I'm not surprised that it doesnt' work. You cannot bring in VTK and >> ParaView in the same project. If you project depends on both, you >> should just include ParaView and you'll get access to most of VTK as >> well (I can't think of anything we disable explicitly when importing >> VTK, but I may be wrong). >> >> Utkarsh >> >> On Wed, Sep 7, 2011 at 9:29 AM, Mathieu Malaterre >> <[email protected]> wrote: >> > Hi all, >> > >> > I am trying to build a paraview module. I have VTK 5.8.0 and >> > ParaView 3.10.1 installed on a linux/debian machine. When importing >> > both VTK & ParaView cmake module, I am getting the following errors >> > (truncated): >> > >> > ... >> > CMake Error at /tmp/pv/usr/lib/paraview/CMake/ParaViewTargets.cmake:16 >> > (ADD_EXECUTABLE): >> > add_executable cannot create imported target "vtkWrapPython" because >> > another target with the same name already exists. >> > Call Stack (most recent call first): >> > /tmp/pv/usr/lib/paraview/ParaViewConfig.cmake:58 (INCLUDE) >> > CMakeLists.txt:3 (find_package) >> > >> > >> > CMake Error at /tmp/pv/usr/lib/paraview/CMake/ParaViewTargets.cmake:19 >> > (ADD_EXECUTABLE): >> > add_executable cannot create imported target "vtkWrapPythonInit" >> > because >> > another target with the same name already exists. >> > Call Stack (most recent call first): >> > /tmp/pv/usr/lib/paraview/ParaViewConfig.cmake:58 (INCLUDE) >> > CMakeLists.txt:3 (find_package) >> > ... >> > >> > >> > It can easily be reproduced with: >> > >> > $ cat /tmp/bla/CMakeLists.txt >> > project(bla) >> > find_package(VTK REQUIRED) >> > find_package(ParaView REQUIRED) >> > >> > Could someone please confirm this is an actual issue ? If so I'll >> > report that to paraview bug tracker. Meanwhile could someone please >> > suggest a fix, other than -tediously- adding blockers for each >> > imported target, eg: >> > >> > $ cat /usr/lib/paraview/CMake/ParaViewTargets.cmake >> > ... >> > # Create imported target vtkWrapPython >> > IF(NOT TARGET vtkWrapPython) >> > ADD_EXECUTABLE(vtkWrapPython IMPORTED) >> > ENDIF(NOT TARGET vtkWrapPython) >> > ... >> > >> > This issue can also be seen when building VTKEdge (svn checkout from >> > 20110819). >> > >> > Thanks much ! >> > -- >> > Mathieu >> > _______________________________________________ >> > 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 > > -- Mathieu _______________________________________________ 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
