Where is __VTK_WRAP__ defined?

Building from VTK master with MSVC on Windows, VTK_WRAP seems to be defined in vtkWrappingHints.h.

How/where do I turn it off?

If I turn off VTK_MODULE_ENABLE_VTK_WrappingTools in cmake I get an error
cannot open file /lib/vtk/hierarchy/VTK/vtkCommonDataModel-hierarchy.txt
cannot open file /lib/vtk/hierarchy/VTK/vtkCommonExecutionModel-hierarchy.txt

The __VTK_WRAP__ macro is predefined by the wrapper tools, in vtkParseMain.c:

  /* pre-define the __VTK_WRAP__ macro */
  vtkParse_DefineMacro("__VTK_WRAP__", 0);

It is defined when vtkWrapHierarchy or vtkWrapPython are parsing the code, and it is not defined when the C++ compiler is compiling the code.

In other words, in all circumstances where gcc/clang/msvc etc. are compiling the code, it is already off. It will also be off when castxml is reading the code, unless castxml explicitly predefines it.

Ok. Thanks.

I’m not sure what was going on there as vtk::sizehint was definitely defined when building. Perhaps I added the VTK_WRAP compiler directive to one of the projects manually inside VS. I created a new build folder and started again from scratch, so it’s compiling now.