[vtk-developers] VTK CVS link error, .mm files, VTK_REQUIRED_OBJCXX_FLAGS, and vtkCoreGraphicsGPUInfoList.mm

Francois Bertel francois.bertel at kitware.com
Thu Feb 25 10:14:02 EST 2010


I'll look at that.

Thanks for educating me about Mac stuff. I thought that Core Graphics
API was Cocoa-specific therefore Objective-C(++).

On Wed, Feb 24, 2010 at 8:18 PM, Sean McBride <sean at rogue-research.com> wrote:
> Hi all (especially François I think),
>
> I updated from CVS and although VTK itself builds, my application no
> longer links against it.  This is because of the new
> vtkCoreGraphicsGPUInfoList.mm.  Happily, it will be straightforward to fix.
>
> 1) Objective-C (.m) & Obj-C++ (.mm) code can be compiled using either
> garbage collection or reference counting mode.  Any library that an app
> links to must be built the same way.  So as a library, VTK must (and
> does) support both.
>
> The choice is decided by compiler flag (ex -fobjc-gc).  gcc accepts this
> flag only for .m and .mm files (complains otherwise).  Alas, CMake does
> not have an Objective-C equivalent of CMAKE_CXX_FLAGS, see:
> <http://public.kitware.com/Bug/view.php?id=4756>
>
> So instead, VTK provides the CMake variable VTK_REQUIRED_OBJCXX_FLAGS
> which it is supposed to pass to all .mm files when compiled.  It mostly
> does.  See Rendering/CMakeLists.txt.  But it does _not_ do this for the
> new vtkCoreGraphicsGPUInfoList.mm (and I just noticed it's also missing
> for vtkCocoaTkUtilities.mm also).
>
> It's a maintenance pain to have to remember this every time a new .mm
> file is added.  Is there some CMake magic that can be done so that
> all .mm files are always compiled with VTK_REQUIRED_OBJCXX_FLAGS?
>
>
> 2) In any case, vtkCoreGraphicsGPUInfoList.mm doesn't contain any
> Objective-C anyway! (except for a use of #import that could change to
> #include) so it should probably be renamed .cxx, unless adding Obj-C
> code to this file is planned....?
>
> Thanks,
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
>
>
> _______________________________________________
> 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
>
>



-- 
François Bertel, PhD  | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
                      | Clifton Park NY 12065, USA



More information about the vtk-developers mailing list