[vtk-developers] Checking if VTK was built with a particular group enabled

Marcus D. Hanwell marcus.hanwell at kitware.com
Fri May 4 11:21:36 EDT 2012


On Fri, May 4, 2012 at 11:09 AM, David Doria <daviddoria at gmail.com> wrote:
>> Yes.  Normally the above should report an error
>>
>>  No such module: vtkFiltersParallel
>>
>> but the test for it is broken in the case that vtkFiltersParallel
>> was enabled in the same build tree in the past and is now disabled.
>> This should fix it:
>>
>>  http://review.source.kitware.com/#/t/551
>>
>> -Brad
>
>
> Thanks Brad, that seems to do it.
>
> Is it intended behavior that if a module is not listed in the
> COMPONENTS list of find_package() it will not be available?
>
> For example, with this:
>
> FIND_PACKAGE(VTK REQUIRED COMPONENTS vtkViewsContext2D vtkChartsCore)
>
> my project builds, but with this:
>
> FIND_PACKAGE(VTK REQUIRED COMPONENTS vtkViewsContext2D)
>
> I get:
> fatal error: vtkChartXY.h: No such file or directory

That is correct behavior, vtkViewsContext2D does not depend on
vtkChartsCore (soon to move - I will get on that). You want both
components if you are using the vtkContextView and the charts.
>
> The project also builds correctly with only:
> FIND_PACKAGE(VTK REQUIRED)

That just finds everything that built.
>
> I had assumed that all modules that had been built were available by
> default, and adding them to the REQUIRED COMPONENTS list was just
> checking for them?
>
No, this behaves in much the same way as Boost where the
BOOST_LIBRARIES variable is populated with the components you asked
for. We diverge in that when you ask for nothing we give you
everything by default.

We need to write this up and make it clearer on the wiki.

Marcus



More information about the vtk-developers mailing list