[vtk-developers] disabling png

David Cole DLRdave at aol.com
Sun Nov 20 11:32:16 EST 2016


If you set the CMake cache variable VTK_USE_SYSTEM_PNG to ON when you
are configuring VTK, it should avoid pulling in the built-in VTK png
library. And the VTK stuff that depends on the png library should be
able to use your patched one just fine unless you have significantly
altered the api to the library in some way with your patch.

There are also several other VTK_USE_SYSTEM_* variables for the third
party libraries.


HTH,
David C.


On Sat, Nov 19, 2016 at 7:31 PM, Mario Emmenlauer <mario at emmenlauer.de> wrote:
>
> Dear Bill, thanks for the nice reply! But my use case is different, I want
> to avoid bringing certain third-party libraries into VTK. An example is
> libpng, I have a specific (patched) version that my application needs to
> use. My version is not interface compatible with VTK's internal version,
> so I can't just tell cmake to link my (system) version. However when I
> let VTK use its internal version, my app eventually crashes after showing
> an error that its compiled against a different libpng version than its
> linked against. So it seems VTK 'pollutes' my dll space.
>
> Can I somehow just disable everything related to libpng in VTK? And same for
> NetCDF and HDF5? So far I've tested removing the source directories, and my
> mileage is surprisingly good, but its quite a bit hackish...
>
> Cheers,
>
>     Mario
>
>
>
>
> On 19.11.2016 20:04, Bill Lorensen wrote:
>> You can build your app my selecting which components you need from a built VTK.
>> For example, I have an app that just uses these components:
>> find_package(VTK COMPONENTS
>>   vtkFiltersGeneral
>>   vtkFiltersGeometry
>>   vtkIOGeometry
>>   vtkIOImage
>>   vtkIOLegacy
>>   vtkImagingStatistics
>>   vtkInteractionWidgets
>>   vtkRenderingOpenGL2
>> )
>>
>> You can also build a VTK that is stripped down. I'm not sure which use
>> case you have...
>>
>>
>> On Sat, Nov 19, 2016 at 1:28 PM, Mario Emmenlauer <mario at emmenlauer.de> wrote:
>>>
>>> What you say makes perfect sense! But actually I just realized that VTK
>>> offers quite a bit more functionality than I use, and some of this comes
>>> (for me) at the price of dll-hell (or the equivalent on Linux :-) ).
>>>
>>> I guess what I'm really looking for would be VTK_DISABLE_IMAGE_READERS
>>> for hdf5, netcdf, tiff, png, ogg, json and similar, leaving mostly the
>>> rendering and interactors etc and their dependencies in place. I found
>>> options to disable Tk, Java, Python. Are there options to further strip
>>> down VTK, or tune it to specific use cases?
>>>
>>> All the best,
>>>
>>>     Mario
>>>
>>>
>>>
>>>
>>> On 19.11.2016 18:40, Bill Lorensen wrote:
>>>> Just be careful with these system libraries. Sne th9ird party packages
>>>> change their api's, so we can really only guarantee results with those
>>>> that we include with vtk.
>>>>
>>>>
>>>> On Sat, Nov 19, 2016 at 12:31 PM, Mario Emmenlauer <mario at emmenlauer.de> wrote:
>>>>>
>>>>> Dear Utkarsh,
>>>>>
>>>>> oh my, thanks a lot, exactly what I need! Great! And there are a
>>>>> bunch more VTK_USE_SYSTEM_XXX options that I did not find before,
>>>>> great!
>>>>>
>>>>> Cheers,
>>>>>
>>>>>     Mario
>>>>>
>>>>>
>>>>> On 19.11.2016 18:13, Utkarsh Ayachit wrote:
>>>>>> You can tell VTK to use system PNG. Set VTK_USE_SYSTEM_PNG CMake variable to ON.
>>>>>>
>>>>>> Utkarsh
>>>>>>
>>>>>> On Sat, Nov 19, 2016 at 11:53 AM, Mario Emmenlauer <mario at emmenlauer.de> wrote:
>>>>>>>
>>>>>>> I've just tracked down an issue for quite a while and found that
>>>>>>> VTK brings its own PNG library! This is causing my quite a head-
>>>>>>> ache. I've googled and read the CMakeLists.txt, but could not find
>>>>>>> how to disable it. Can you please help?
>>>>>>>
>>>>>>> How to disable VTK's internal libpng?
>>>>>>>
>>>>>>> Thanks for your help,
>>>>>>>
>>>>>>>     Mario
>>>>>>> _______________________________________________
>>>>>>> Powered by www.kitware.com
>>>>>>>
>>>>>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>>>>>>
>>>>>>> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>>>>>>>
>>>>>>> Follow this link to subscribe/unsubscribe:
>>>>>>> http://public.kitware.com/mailman/listinfo/vtk-developers
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtk-developers
>


More information about the vtk-developers mailing list