Search code examples
qtqt-creatormysql-connectorqt6

Making QMYSQL driver


I was trying to make QMYSQL driver using official site: https://doc.qt.io/qt-6/sql-driver.html#qmysql. I enter this to the command line:

qt-cmake -G Ninja "C:\Qt1\6.8.1\Src\qtbase\src\plugins\sqldrivers" -DCMAKE_INSTALL_PREFIX="C:\Qt1\6.8.1\msvc2022_64" -DMySQL_ROOT="C:\Program Files\MySQL\MySQL Server 8.0"

and I get this:

CMake Error at C:/Qt1/6.8.1/mingw_64/lib/cmake/Qt6/QtPublicSbomHelpers.cmake:2552 (message):
  No SBOM project name was set.
Call Stack (most recent call first):
  C:/Qt1/6.8.1/mingw_64/lib/cmake/Qt6/QtPublicSbomHelpers.cmake:2542 (_qt_internal_sbom_get_root_project_name_lower_case)
  C:/Qt1/6.8.1/mingw_64/lib/cmake/Qt6/QtPublicSbomHelpers.cmake:2636 (_qt_internal_sbom_get_root_project_name_for_spdx_id)
  C:/Qt1/6.8.1/mingw_64/lib/cmake/Qt6/QtPublicSbomHelpers.cmake:2603 (_qt_internal_sbom_generate_target_package_spdx_id)
  C:/Qt1/6.8.1/mingw_64/lib/cmake/Qt6/QtPublicSbomHelpers.cmake:1926 (_qt_internal_sbom_record_target_spdx_id)
  C:/Qt1/6.8.1/mingw_64/lib/cmake/Qt6/QtPluginHelpers.cmake:446 (_qt_internal_extend_sbom)
  mysql/CMakeLists.txt:8 (qt_internal_add_plugin)

I tried to add this command to the end of my request:

-DQT_NO_CREATE_SBOM=ON

Also I tried to add this:

set(QT_SBOM_PROJECT_NAME "mysql_driver")

in the CMakeList.txt from:

C:\Qt1\6.8.1\Src\qtbase\src\plugins\sqldrivers\mysql

I don't know what to do.


Solution

  • As metioned in https://bugreports.qt.io/browse/QTBUG-131799, you should use -DQT_GENERATE_SBOM=OFF in the cmake command line