Multiple errors with Qt, qsql_mysql, while building ParaView on MacOS

I have been trying to build ParaView to test the custom apps examples here on MacOS.

I have followed the site instructions for the superbuild here.

I have had several problems with the Qt build, after some tweaking here is the result

These are the steps I have done:

$ mkdir pv
$ cd pv
$ git clone https://gitlab.kitware.com/paraview/paraview-superbuild.git
$ cd paraview-superbuild
$ git fetch origin # ensure you have the latest state from the main repo
$ git submodule update

$ cd ..
$ mkdir paraview_build
$ cd paraview_build
$ cmake ../paraview-superbuild
$ ccmake -DCMAKE_OSX_SDK=macosx10.14 ../paraview-superbuild

I enabled the CMake variables:

ENABLE_qt5
ENABLE_python
ENABLE_python2

Then ran:

$ make

First, I got the error

/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm:833:20: error: qualified reference to 'QFixed' is a constructor name rather than a type in this context
    return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont)));

Which was solved by going to the file /Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm and remove QFixed:: prefix in line 833

After that, I re run make and got a lot more errors

  ~ cd Desktop/dev/pv
➜  pv ls
paraview-superbuild paraview_build
➜  pv cd paraview_build
➜  paraview_build clear
➜  paraview_build ls
CMakeCache.txt        CTestCustom.cmake     DartConfiguration.tcl Testing               cpack                 install               tests
CMakeFiles            CTestTestfile.cmake   Makefile              cmake_install.cmake   downloads             superbuild
➜  paraview_build make
[  3%] Built target cxx11_check
[ 14%] Built target szip
[ 24%] Built target zlib
[ 37%] Built target hdf5
[ 46%] Built target cxx11
[ 56%] Built target nlohmannjson
[ 67%] Built target python2
[ 79%] Built target python
[ 80%] Performing build step for 'qt5'
Makefile:2392: warning: overriding commands for target `../../lib/QtGui.framework/Versions/5/Headers/QGenericPlugin'
Makefile:2024: warning: ignoring old commands for target `../../lib/QtGui.framework/Versions/5/Headers/QGenericPlugin'
Makefile:2396: warning: overriding commands for target `../../lib/QtGui.framework/Versions/5/Headers/QGenericPluginFactory'
Makefile:2020: warning: ignoring old commands for target `../../lib/QtGui.framework/Versions/5/Headers/QGenericPluginFactory'
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/plugins/sqldrivers/mysql/qsql_mysql.cpp:235:9: error: unknown type name 'my_bool'
        my_bool nullIndicator;
        ^
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/plugins/sqldrivers/mysql/qsql_mysql.cpp:986:13: error: use of undeclared identifier 'my_bool'
    QVector<my_bool> nullVector;
            ^
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/plugins/sqldrivers/mysql/qsql_mysql.cpp:1000:9: error: use of undeclared identifier 'nullVector'
        nullVector.resize(values.count());
        ^
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/plugins/sqldrivers/mysql/qsql_mysql.cpp:1007:13: error: use of undeclared identifier 'nullVector'
            nullVector[i] = static_cast<my_bool>(val.isNull());
            ^
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/plugins/sqldrivers/mysql/qsql_mysql.cpp:1007:41: error: unknown type name 'my_bool'
            nullVector[i] = static_cast<my_bool>(val.isNull());
                                        ^
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/plugins/sqldrivers/mysql/qsql_mysql.cpp:1008:34: error: use of undeclared identifier 'nullVector'; did you mean 'nullptr'?
            currBind->is_null = &nullVector[i];
                                 ^~~~~~~~~~
                                 nullptr
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/plugins/sqldrivers/mysql/qsql_mysql.cpp:1008:33: error: cannot take the address of an rvalue of type 'nullptr_t'
            currBind->is_null = &nullVector[i];
                                ^~~~~~~~~~~
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/plugins/sqldrivers/mysql/qsql_mysql.cpp:1104:9: error: unknown type name 'my_bool'
        my_bool update_max_length = true;
        ^
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/plugins/sqldrivers/mysql/qsql_mysql.cpp:1315:5: error: unknown type name 'my_bool'
    my_bool reconnect=false;
    ^
In file included from /Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/plugins/sqldrivers/mysql/qsql_mysql.cpp:47:
In file included from /Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/include/QtSql/qsqlindex.h:1:
In file included from /Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/include/QtSql/../../src/sql/kernel/qsqlindex.h:46:
In file included from /Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/include/QtCore/qvector.h:1:
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/include/QtCore/../../src/corelib/tools/qvector.h:415:24: error: too many arguments to function call, expected single argument 'sz', have 3 arguments
    reallocData(asize, newAlloc, opt);
    ~~~~~~~~~~~        ^~~~~~~~~~~~~
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/plugins/sqldrivers/mysql/qsql_mysql.cpp:399:12: note: in instantiation of member function 'QVector<QMYSQLResultPrivate::QMyField>::resize' requested here
    fields.resize(mysql_num_fields(meta));
           ^
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/include/QtCore/../../src/corelib/tools/qvector.h:296:5: note: 'reallocData' declared here
    void reallocData(const int sz) { reallocData(sz, d->alloc); }
    ^
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/include/QtCore/../../src/corelib/tools/qvector.h:296:54: error: too many arguments to function call, expected single argument 'sz', have 2 arguments
    void reallocData(const int sz) { reallocData(sz, d->alloc); }
                                     ~~~~~~~~~~~     ^~~~~~~~
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/include/QtCore/../../src/corelib/tools/qvector.h:415:5: note: in instantiation of member function 'QVector<QMYSQLResultPrivate::QMyField>::reallocData' requested here
    reallocData(asize, newAlloc, opt);
    ^
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/plugins/sqldrivers/mysql/qsql_mysql.cpp:399:12: note: in instantiation of member function 'QVector<QMYSQLResultPrivate::QMyField>::resize' requested here
    fields.resize(mysql_num_fields(meta));
           ^
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/include/QtCore/../../src/corelib/tools/qvector.h:296:5: note: 'reallocData' declared here
    void reallocData(const int sz) { reallocData(sz, d->alloc); }
    ^
11 errors generated.
make[8]: *** [.obj/qsql_mysql.o] Error 1
make[7]: *** [sub-mysql-make_first] Error 2
make[6]: *** [sub-sqldrivers-make_first] Error 2
make[5]: *** [sub-plugins-make_first] Error 2
make[4]: *** [sub-src-make_first] Error 2
make[3]: *** [module-qtbase-make_first] Error 2
CMake Error at /Users/username/Desktop/dev/pv/paraview_build/superbuild/sb-qt5-build.cmake:47 (message):
  Failed with exit code 2


make[2]: *** [superbuild/qt5/stamp/qt5-build] Error 1
make[1]: *** [superbuild/CMakeFiles/qt5.dir/all] Error 2
make: *** [all] Error 2

It seems to be a problem with qsql_mysql.

Any ideas?

This has the same solution as this question: ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken. While building ParaView to execute Qt custom apps