[vtk-developers] backward compatible cmake support for vtk modular

Jean-Christophe Fillion-Robin jchris.fillionr at kitware.com
Fri Mar 30 19:57:47 EDT 2012


Hi Pat,

Within ITK,  you could do the following [1]:

  MyProject
     |----- LibA   (depends on ITKFoo and ITKBar)
     |------LibB  (depends on ITKFoo)

Considering your project has two libraries and that these library have
different requirement regarding the ITK module they need, you could do:

In MyProject/LibA/CMakeLists.txt

   find_package(ITK COMPONENTS ITKFoo ITKBar)


In MyProject/LibB/CMakeLists.txt

   find_package(ITK COMPONENTS ITKFoo)

I believe the same should be possible within VTK modular.

What I wonder is where the name of components are described / listed.

Hth
Jc

[1]
http://wiki.slicer.org/slicerWiki/index.php/Documentation/Snapshot/Developers/Overlinking_Underlinking#Reply_from_Brad_King
[2] http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_package

On Fri, Mar 30, 2012 at 7:40 PM, Pat Marion <pat.marion at kitware.com> wrote:

> I could be wrong, but I thought that using VTK_LIBRARIES would cause your
> project to link to all vtk libraries, when you may only want to link with
> specific ones, like vtkFiltering (or vtkFiltersCore for modularized.)
>
> Also, is there is a cmake flag that can determine whether or not the vtk
> in use if modularized or not?  Perhaps just looking at the VTK version
> number?
>
> Pat
>
>
> On Fri, Mar 30, 2012 at 7:28 PM, Bill Lorensen <bill.lorensen at gmail.com>wrote:
>
>> I think if you use VTK_LIBRARIES in your target_link_libraries
>> everything should be OK. With ITK modular, applications use
>> ITK_LIBRARIES without problems for both ITKv3 and ITKv4.
>>
>> On Fri, Mar 30, 2012 at 4:19 PM, Pat Marion <pat.marion at kitware.com>
>> wrote:
>> > Hi,
>> >
>> > It seems fairly straightforward to have a project support vtk 5 and vtk
>> 6,
>> > but what about cmake code that can support both vtk and vtk modular?
>> Any
>> > examples of what that might look like?
>> >
>> > The reason I ask is... PCL uses VTK on the desktop, but what if I want
>> to
>> > use VTK+VES  for PCL on mobile.  Then the PCL cmake system should know
>> how
>> > to use vtk modular, since VES uses vtk modular.
>> >
>> > Pat
>> >
>> > _______________________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://www.vtk.org/mailman/listinfo/vtk-developers
>> >
>> >
>>
>>
>>
>> --
>> Unpaid intern in BillsBasement at noware dot com
>>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
>


-- 
+1 919 869 8849
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20120330/d5a0a363/attachment.html>


More information about the vtk-developers mailing list