title: cmake + qt + vtk: Compilation errors in macOS Mojave
body: <p>I'm running macOS Mojave (10.14.3).
  After the upgrade to Mojave <em>something</em> in my system changed and I no longer can compile code having <code>VTK</code> and <code>Qt</code>.</p>
  
  <p>A (not) working example can be found in the examples given by <a href="https://lorensen.github.io/VTKExamples/site/Cxx/Qt/SideBySideRenderWindowsQt/#download-and-build-sidebysiderenderwindowsqt" rel="nofollow noreferrer">VTK</a>.</p>
  
  <p>It's worth to mention,  that I can compile the other examples not involving <code>qt</code>.</p>
  
  <p>I use <code>homebrew</code> to install everything I need. </p>
  
  <p>Hier are the logs: </p>
  
  <pre><code>cmake ..
  -- The C compiler identification is AppleClang 10.0.1.10010046
  -- The CXX compiler identification is AppleClang 10.0.1.10010046
  -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
  -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
  -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- VTK_VERSION: 8.1.2
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /Users/chraibi/Downloads/VTK_Examples/SideBySideRenderWindowsQt/build
  </code></pre>
  
  <p>and </p>
  
  <pre><code>make 
  In file included from /Users/user/Downloads/VTK_Examples/SideBySideRenderWindowsQt/build/SideBySideRenderWindowsQt_autogen/mocs_compilation.cpp:2:
  In file included from /Users/user/Downloads/VTK_Examples/SideBySideRenderWindowsQt/build/SideBySideRenderWindowsQt_autogen/EWIEGA46WW/moc_SideBySideRenderWindowsQt.cpp:9:
  In file included from /Users/user/Downloads/VTK_Examples/SideBySideRenderWindowsQt/build/SideBySideRenderWindowsQt_autogen/EWIEGA46WW/../../../SideBySideRenderWindowsQt.h:6:
  In file included from /usr/local/opt/qt/lib/QtWidgets.framework/Headers/QMainWindow:1:
  In file included from /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qmainwindow.h:44:
  In file included from /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qwidget.h:52:
  /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qsizepolicy.h:51:82: error: invalid token at start of a preprocessor expression
  #if !defined(Q_CC_GNU) || defined(Q_CC_INTEL) || defined(Q_CC_CLANG) || Q_CC_GNU &gt;= 408
                                                                                   ^
  /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qsizepolicy.h:68:1: error: unknown type name 'Q_DECL_CONST_FUNCTION'
  Q_DECL_CONST_FUNCTION inline uint qHash(QSizePolicy key, uint seed = 0) Q_DECL_NOTHROW;
  ^
  /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qsizepolicy.h:68:23: error: expected unqualified-id
  Q_DECL_CONST_FUNCTION inline uint qHash(QSizePolicy key, uint seed = 0) Q_DECL_NOTHROW;
                        ^
  /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qsizepolicy.h:91:5: error: unknown type name 'Q_ENUM'
      Q_ENUM(Policy)
      ^
  /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qsizepolicy.h:91:19: error: expected ';' at end of declaration list
      Q_ENUM(Policy)
                    ^
  /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qsizepolicy.h:110:35: error: use of undeclared identifier 'ControlType'
      Q_DECLARE_FLAGS(ControlTypes, ControlType)
                                    ^
  /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qsizepolicy.h:111:5: error: unknown type name 'Q_FLAG'
      Q_FLAG(ControlTypes)
      ^
  /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qsizepolicy.h:111:12: error: duplicate member 'ControlTypes'
      Q_FLAG(ControlTypes)
             ^
  /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qsizepolicy.h:110:21: note: previous declaration is here
      Q_DECLARE_FLAGS(ControlTypes, ControlType)
                      ^
  /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qsizepolicy.h:111:25: error: expected ';' at end of declaration list
      Q_FLAG(ControlTypes)
                          ^
  /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qsizepolicy.h:132:5: error: unknown type name 'Q_DECL_RELAXED_CONSTEXPR'
      Q_DECL_RELAXED_CONSTEXPR void setHorizontalPolicy(Policy d) Q_DECL_NOTHROW { bits.horPolicy = d; }
      ^
  /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qsizepolicy.h:132:30: error: expected member name or ';' after declaration specifiers
      Q_DECL_RELAXED_CONSTEXPR void setHorizontalPolicy(Policy d) Q_DECL_NOTHROW { bits.horPolicy = d; }
      ~~~~~~~~~~~~~~~~~~~~~~~~ ^
  /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qsizepolicy.h:136:73: error: expected ';' at end of declaration list
      QT_SIZEPOLICY_CONSTEXPR Qt::Orientations expandingDirections() const Q_DECL_NOTHROW {
                                                                          ^
  /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qsizepolicy.h:153:58: error: expected ';' at end of declaration list
      QT_SIZEPOLICY_CONSTEXPR int horizontalStretch() const Q_DECL_NOTHROW { return static_cast&lt;int&gt;(bits.horStretch); }
                                                           ^
  /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qsizepolicy.h:176:47: error: expected ';' at end of declaration list
      QT_SIZEPOLICY_CONSTEXPR QSizePolicy(int i) Q_DECL_NOTHROW : data(i) { }
                                                ^
  /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qsizepolicy.h:178:50: error: unknown type name 'Bits'
      QT_SIZEPOLICY_CONSTEXPR explicit QSizePolicy(Bits b) Q_DECL_NOTHROW : bits(b) { }
                                                   ^
  /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qsizepolicy.h:178:57: error: expected ';' at end of declaration list
      QT_SIZEPOLICY_CONSTEXPR explicit QSizePolicy(Bits b) Q_DECL_NOTHROW : bits(b) { }
                                                          ^
  /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qsizepolicy.h:223:9: error: unknown type name 'Bits'
          Bits bits;
          ^
  /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qsizepolicy.h:231:33: error: use of undeclared identifier 'Q_RELOCATABLE_TYPE'; did you mean 'Q_MOVABLE_TYPE'?
  Q_DECLARE_TYPEINFO(QSizePolicy, Q_RELOCATABLE_TYPE);
                                  ^
  /usr/local/include/QtCore/qglobal.h:2272:5: note: 'Q_MOVABLE_TYPE' declared here
      Q_MOVABLE_TYPE = 0x2,
      ^
  In file included from /Users/user/Downloads/VTK_Examples/SideBySideRenderWindowsQt/build/SideBySideRenderWindowsQt_autogen/mocs_compilation.cpp:2:
  In file included from /Users/user/Downloads/VTK_Examples/SideBySideRenderWindowsQt/build/SideBySideRenderWindowsQt_autogen/EWIEGA46WW/moc_SideBySideRenderWindowsQt.cpp:9:
  In file included from /Users/user/Downloads/VTK_Examples/SideBySideRenderWindowsQt/build/SideBySideRenderWindowsQt_autogen/EWIEGA46WW/../../../SideBySideRenderWindowsQt.h:6:
  In file included from /usr/local/opt/qt/lib/QtWidgets.framework/Headers/QMainWindow:1:
  In file included from /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qmainwindow.h:44:
  In file included from /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qwidget.h:52:
  /usr/local/opt/qt/lib/QtWidgets.framework/Headers/qsizepolicy.h:231:33: error: use of undeclared identifier 'Q_RELOCATABLE_TYPE'; did you mean 'Q_MOVABLE_TYPE'?
  Q_DECLARE_TYPEINFO(QSizePolicy, Q_RELOCATABLE_TYPE);
                                  ^
  /usr/local/include/QtCore/qglobal.h:2272:5: note: 'Q_MOVABLE_TYPE' declared here
      Q_MOVABLE_TYPE = 0x2,
      ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  20 errors generated.
  make[2]: *** [CMakeFiles/SideBySideRenderWindowsQt.dir/SideBySideRenderWindowsQt_autogen/mocs_compilation.cpp.o] Error 1
  make[1]: *** [CMakeFiles/SideBySideRenderWindowsQt.dir/all] Error 2
  make: *** [all] Error 2
  </code></pre>
  
  <p>Similar error I get with <code>cmake  -DCMAKE_CXX_COMPILER=g++-8</code>, where g++-8 is installed with <code>brew</code></p>
  
  <p>Maybe I should mention, there is a <a href="https://github.com/JuPedSim/homebrew-jps" rel="nofollow noreferrer">software</a> using <code>vtk</code> and <code>qt</code> that I can install via <code>brew</code> without any problems. The same software cannot be compiled directly (cmake --> make). </p>
  
  <p>Could be something with my OS is wrong? </p>