[vtk-developers] VTK_MAJOR_VERSION is no longer #define'ed

Bill Lorensen bill.lorensen at gmail.com
Wed Apr 25 10:08:12 EDT 2012


I really do not want to turn VTK_LEGACY_REMOVE OFF. If enables much
more than the new versioning.

In the hundreds of examples I have converted to work with both VTK5
and VTK6 I've used this pattern:
#if VTK_MAJOR_VERSION <= 5
  inputMapper->SetInput(inputPolyData);
#else
  inputMapper->SetInputData(inputPolyData);
#endif

I would like this code to work without having to add another #include.

On Wed, Apr 25, 2012 at 9:00 AM, David Cole <david.cole at kitware.com> wrote:
> Brad's commit comment from:
>
>   http://public.kitware.com/gitweb?p=VTK.git;a=commitdiff;h=ebf6777d50112b2bc98552e0781a2405552c7947
>
> says:
>
> "Move the preprocessor macros
> from "vtkConfigure.h" to new configured header "vtkVersionMacros.h".
> This avoids rebuilding everything when the version number changes.
> Include the new header from the old location to provide the macros for
> compatibility unless VTK_LEGACY_REMOVE is ON."
>
>
> On Wed, Apr 25, 2012 at 8:58 AM, Brad King <brad.king at kitware.com> wrote:
>>
>> On Wed, Apr 25, 2012 at 8:46 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>> > Is the define for VTK_MAJOR_VERSION now gone unless we include the
>> > vtkVersionMacros.h? Without changing the LEGACY settings, how can I
>> > conditionally use code at compile time based on the VTK version?
>>
>> If you include vtkVersion.h you will get the macros in all versions.
>>
>> If VTK_LEGACY_REMOVE is OFF it should still be in vtkConfigure.h.
>>
>> -Brad
>> _______________________________________________
>> 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



More information about the vtk-developers mailing list