How to compile VTK 8.2.0 with gcc-7 and Qt 5.9.1 on MacOS 10.14?

@dgobbi

I just tried building with the option VTK_USE_SYSTEM_FREETYPE=ON
Fortunately, CMake found freetype automatically without installing anything here: /opt/local/lib/libfreetype.dylib

Unfortunately, it failed to build with a huge list of errors. Here is just an excerpt of more than 35.000 lines:

[ 50%] Building CXX object Rendering/OpenGL2/CMakeFiles/vtkRenderingOpenGL2.dir/vtkTextureObjectVS.cxx.o
[ 50%] Building CXX object Rendering/OpenGL2/CMakeFiles/vtkRenderingOpenGL2.dir/vtkDummyGPUInfoList.cxx.o
[ 50%] Building CXX object Rendering/OpenGL2/CMakeFiles/vtkRenderingOpenGL2.dir/vtkCocoaRenderWindowInteractor.mm.o
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/object.h:101:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch.h:48,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:20,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:17,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:60,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/NSObject.h:22:4: error: 'instancetype' does not name a type; did you mean 'iswctype'?
 - (instancetype)self;
    ^~~~~~~~~~~~
    iswctype
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/NSObject.h:36:4: error: 'instancetype' does not name a type; did you mean 'iswctype'?
 - (instancetype)retain OBJC_ARC_UNAVAILABLE;
    ^~~~~~~~~~~~
    iswctype
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/NSObject.h:38:4: error: 'instancetype' does not name a type; did you mean 'iswctype'?
 - (instancetype)autorelease OBJC_ARC_UNAVAILABLE;
    ^~~~~~~~~~~~
    iswctype
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/NSObject.h:63:4: error: 'instancetype' does not name a type; did you mean 'iswctype'?
 - (instancetype)init
    ^~~~~~~~~~~~
    iswctype
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/NSObject.h:69:4: error: 'instancetype' does not name a type; did you mean 'iswctype'?
 + (instancetype)new OBJC_SWIFT_UNAVAILABLE("use object initializers instead");
    ^~~~~~~~~~~~
    iswctype
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/NSObject.h:70:4: error: 'instancetype' does not name a type; did you mean 'iswctype'?
 + (instancetype)allocWithZone:(struct _NSZone *)zone OBJC_SWIFT_UNAVAILABLE("use object initializers instead");
    ^~~~~~~~~~~~
    iswctype
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/NSObject.h:71:4: error: 'instancetype' does not name a type; did you mean 'iswctype'?
 + (instancetype)alloc OBJC_SWIFT_UNAVAILABLE("use object initializers instead");
    ^~~~~~~~~~~~
    iswctype
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:5:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:19:21: error: 'nullable' does not name a type; did you mean '_Nullable'?
 - (id)copyWithZone:(nullable NSZone *)zone;
                     ^~~~~~~~
                     _Nullable
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:25:28: error: 'nullable' does not name a type; did you mean '_Nullable'?
 - (id)mutableCopyWithZone:(nullable NSZone *)zone;
                            ^~~~~~~~
                            _Nullable
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:32:4: error: 'nullable' does not name a type; did you mean '_Nullable'?
 - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder; // NS_DESIGNATED_INITIALIZER
    ^~~~~~~~
    _Nullable
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:5:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:43:12: error: expected identifier before 'class'
 @property (class, readonly) BOOL supportsSecureCoding;
            ^~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:43:12: error: expected ')' before 'class'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:53:4: error: 'nullable' does not name a type; did you mean '_Nullable'?
 - (nullable id)replacementObjectForCoder:(NSCoder *)aCoder;
    ^~~~~~~~
    _Nullable
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:54:4: error: 'nullable' does not name a type; did you mean '_Nullable'?
 - (nullable id)awakeAfterUsingCoder:(NSCoder *)aDecoder NS_REPLACES_RECEIVER;
    ^~~~~~~~
    _Nullable
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:6:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:7:15: error: expected ';' before '<' token
 @class NSArray<ObjectType>;
               ^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:6:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:34:35: error: cannot find protocol declaration for 'ObjectType'
 @interface NSEnumerator<ObjectType> : NSObject <NSFastEnumeration>
                                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:34:37: error: expected unqualified-id before ':' token
 @interface NSEnumerator<ObjectType> : NSObject <NSFastEnumeration>
                                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:35: error: duplicate interface declaration for class 'NSEnumerator'
 @interface NSEnumerator<ObjectType> (NSExtendedEnumerator)
                                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:35: error: cannot find protocol declaration for 'ObjectType'
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:5:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:10:60: error: redefinition of 'struct NSEnumerator'
 @class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
                                                            ^~~~~~~~~~~~
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:6:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:35: error: trying to finish struct, but kicked out due to previous parse errors
 @interface NSEnumerator<ObjectType> (NSExtendedEnumerator)
                                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:42:1: error: expected constructor, destructor, or type conversion before 'property'
 @property (readonly, copy) NSArray<ObjectType> *allObjects;
 ^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSRange.h:5:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:7,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:18:4: error: 'nullable' does not name a type; did you mean '_Nullable'?
 - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER;
    ^~~~~~~~
    _Nullable
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:31:42: error: 'nullable' does not name a type; did you mean '_Nullable'?
 + (NSValue *)valueWithNonretainedObject:(nullable id)anObject;
                                          ^~~~~~~~
                                          _Nullable
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:32:20: error: unknown property attribute before ',' token
 @property (nullable, readonly) id nonretainedObjectValue;
                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:32:20: error: expected ')' before ',' token
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:32:1: note: 'assign' can be unsafe for Objective-C objects; please state explicitly if you need it
 @property (nullable, readonly) id nonretainedObjectValue;
 ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:34:32: error: 'nullable' does not name a type; did you mean '_Nullable'?
 + (NSValue *)valueWithPointer:(nullable const void *)pointer;
                                ^~~~~~~~
                                _Nullable
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:35:20: error: unknown property attribute before ',' token
 @property (nullable, readonly) void *pointerValue;
                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:35:20: error: expected ')' before ',' token
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:43:4: error: 'nullable' does not name a type; did you mean '_Nullable'?
 - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER;
    ^~~~~~~~
    _Nullable
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSRange.h:5:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:7,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:82:38: error: 'nullable' does not name a type; did you mean '_Nullable'?
 - (NSString *)descriptionWithLocale:(nullable id)locale;
                                      ^~~~~~~~
                                      _Nullable
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:16:42: error: cannot find protocol declaration for 'ObjectType'
 @interface NSArray<__covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
                                          ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:16:44: error: expected unqualified-id before ':' token
 @interface NSArray<__covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
                                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:19:4: error: 'ObjectType' does not name a type; did you mean 'ResType'?
 - (ObjectType)objectAtIndex:(NSUInteger)index;
    ^~~~~~~~~~
    ResType
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:21:40: error: expected ')' before 'ObjectType'
 - (instancetype)initWithObjects:(const ObjectType _Nonnull [_Nullable])objects count:(NSUInteger)cnt NS_DESIGNATED_INITIALIZER;
                                        ^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:21:60: error: expected ';' before '[' token
 - (instancetype)initWithObjects:(const ObjectType _Nonnull [_Nullable])objects count:(NSUInteger)cnt NS_DESIGNATED_INITIALIZER;
                                                            ^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:22:4: error: 'nullable' does not name a type; did you mean '_Nullable'?
 - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER;
    ^~~~~~~~
    _Nullable
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:30: error: duplicate interface declaration for class 'NSArray'
 @interface NSArray<ObjectType> (NSExtendedArray)
                              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:30: error: cannot find protocol declaration for 'ObjectType'
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:6:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:7:8: error: redefinition of 'struct NSArray'
 @class NSArray<ObjectType>;
        ^~~~~~~
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:30: error: trying to finish struct, but kicked out due to previous parse errors
 @interface NSArray<ObjectType> (NSExtendedArray)
                              ^
... (many more, about 35.000 lines)