Cannot build MySQL plugin for Windows in QT6.11
-
Yet another Qt version released and the MySQL plugin needs to be built again. There has never been a problem with the earlier versions but for 6.11 cmake fails:
[cmake] Running C:\Program Files\CMake\bin\cmake.exe -S C:/Qt/6.11.0/Src/qtbase/src/plugins/sqldrivers -B D:/C/qt/build-sqldrivers/6.11.0/llvm-mingw_64 in D:\C\qt\build-sqldrivers\6.11.0\llvm-mingw_64.
[cmake] CMake Error at C:/Qt/6.11.0/llvm-mingw_64/lib/cmake/Qt6/QtTargetHelpers.cmake:691 (add_library):
[cmake] add_library cannot create ALIAS target "Qt6::QODBCDriverPlugin" because
[cmake] another target with the same name already exists.
[cmake] Call Stack (most recent call first):
[cmake] C:/Qt/6.11.0/llvm-mingw_64/lib/cmake/Qt6/QtPluginHelpers.cmake:168 (qt_internal_add_target_aliases)
[cmake] odbc/CMakeLists.txt:10 (qt_internal_add_plugin)Does anyone have any ideas?
-
Yet another Qt version released and the MySQL plugin needs to be built again. There has never been a problem with the earlier versions but for 6.11 cmake fails:
[cmake] Running C:\Program Files\CMake\bin\cmake.exe -S C:/Qt/6.11.0/Src/qtbase/src/plugins/sqldrivers -B D:/C/qt/build-sqldrivers/6.11.0/llvm-mingw_64 in D:\C\qt\build-sqldrivers\6.11.0\llvm-mingw_64.
[cmake] CMake Error at C:/Qt/6.11.0/llvm-mingw_64/lib/cmake/Qt6/QtTargetHelpers.cmake:691 (add_library):
[cmake] add_library cannot create ALIAS target "Qt6::QODBCDriverPlugin" because
[cmake] another target with the same name already exists.
[cmake] Call Stack (most recent call first):
[cmake] C:/Qt/6.11.0/llvm-mingw_64/lib/cmake/Qt6/QtPluginHelpers.cmake:168 (qt_internal_add_target_aliases)
[cmake] odbc/CMakeLists.txt:10 (qt_internal_add_plugin)Does anyone have any ideas?
-
This is using C:\Qt\6.11.0\Src\qtbase\src\plugins\sqldrivers\CMakeLists.txt as the project (which is the way I have done it for previous versions 6.9 to 6.10.2). If you try and use C:\Qt\6.11.0\Src\qtbase\src\plugins\sqldrivers\mysql\CMakeLists.txt as the project you get:
[cmake] Running C:\Qt\Tools\CMake_64\bin\cmake.exe -S C:/Qt/6.11.0/Src/qtbase/src/plugins/sqldrivers/mysql -B C:/Qt/6.11.0/Src/qtbase/src/plugins/sqldrivers/mysql/build/Desktop_Qt_6_11_0_llvm_mingw_64_bit-Debug "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DCMAKE_PREFIX_PATH:PATH=C:/Qt/6.11.0/llvm-mingw_64" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Qt/Tools/llvm-mingw1706_64/bin/clang++.exe" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=C:\Qt\6.11.0\Src\qtbase\src\plugins\sqldrivers\mysql\build\Desktop_Qt_6_11_0_llvm_mingw_64_bit-Debug/.qtc/package-manager/auto-setup.cmake" "-DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON" "-DCMAKE_C_COMPILER:FILEPATH=C:/Qt/Tools/llvm-mingw1706_64/bin/clang.exe" "-DQT_MAINTENANCE_TOOL:FILEPATH=C:/Qt/MaintenanceTool.exe" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG" "-DCMAKE_GENERATOR:STRING=Ninja" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/6.11.0/llvm-mingw_64/bin/qmake.exe" in C:\Qt\6.11.0\Src\qtbase\src\plugins\sqldrivers\mysql\build\Desktop_Qt_6_11_0_llvm_mingw_64_bit-Debug.
[cmake] CMake Warning (dev) in CMakeLists.txt:
[cmake] No project() command is present. The top-level CMakeLists.txt file must
[cmake] contain a literal, direct call to the project() command. Add a line of
[cmake] code such as
[cmake]
[cmake] project(ProjectName)
[cmake]
[cmake] near the top of the file, but after cmake_minimum_required().
[cmake]
[cmake] CMake is pretending there is a "project(Project)" command on the first
[cmake] line.
[cmake] This warning is for project developers. Use -Wno-dev to suppress it.
[cmake]
[cmake] CMake Warning (dev) in CMakeLists.txt:
[cmake] cmake_minimum_required() should be called prior to this top-level project()
[cmake] call. Please see the cmake-commands(7) manual for usage documentation of
[cmake] both commands.
[cmake] This warning is for project developers. Use -Wno-dev to suppress it.
[cmake]
[cmake] -- The C compiler identification is Clang 17.0.6
[cmake] -- The CXX compiler identification is Clang 17.0.6
[cmake] -- Detecting C compiler ABI info
[cmake] -- Detecting C compiler ABI info - done
[cmake] -- Check for working C compiler: C:/Qt/Tools/llvm-mingw1706_64/bin/clang.exe - skipped
[cmake] -- Detecting C compile features
[cmake] -- Detecting C compile features - done
[cmake] -- Detecting CXX compiler ABI info
[cmake] -- Detecting CXX compiler ABI info - done
[cmake] -- Check for working CXX compiler: C:/Qt/Tools/llvm-mingw1706_64/bin/clang++.exe - skipped
[cmake] -- Detecting CXX compile features
[cmake] -- Detecting CXX compile features - done
[cmake] CMake Error at CMakeLists.txt:8 (qt_internal_add_plugin):
[cmake] Unknown CMake command "qt_internal_add_plugin".
[cmake]
[cmake]
[cmake] CMake Warning (dev) in CMakeLists.txt:
[cmake] No cmake_minimum_required command is present. A line of code such as
[cmake]
[cmake] cmake_minimum_required(VERSION 3.30)
[cmake]
[cmake] should be added at the top of the file. The version specified may be lower
[cmake] if you wish to support older CMake versions for this project. For more
[cmake] information run "cmake --help-policy CMP0000".
[cmake] This warning is for project developers. Use -Wno-dev to suppress it.
[cmake]
[cmake] -- Configuring incomplete, errors occurred!
[cmake]
[cmake] The command "C:\Qt\Tools\CMake_64\bin\cmake.exe -S C:/Qt/6.11.0/Src/qtbase/src/plugins/sqldrivers/mysql -B C:/Qt/6.11.0/Src/qtbase/src/plugins/sqldrivers/mysql/build/Desktop_Qt_6_11_0_llvm_mingw_64_bit-Debug "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DCMAKE_PREFIX_PATH:PATH=C:/Qt/6.11.0/llvm-mingw_64" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Qt/Tools/llvm-mingw1706_64/bin/clang++.exe" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=C:\Qt\6.11.0\Src\qtbase\src\plugins\sqldrivers\mysql\build\Desktop_Qt_6_11_0_llvm_mingw_64_bit-Debug/.qtc/package-manager/auto-setup.cmake" "-DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON" "-DCMAKE_C_COMPILER:FILEPATH=C:/Qt/Tools/llvm-mingw1706_64/bin/clang.exe" "-DQT_MAINTENANCE_TOOL:FILEPATH=C:/Qt/MaintenanceTool.exe" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG" "-DCMAKE_GENERATOR:STRING=Ninja" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/6.11.0/llvm-mingw_64/bin/qmake.exe"" terminated with exit code 1.
[cmake]
[cmake] Elapsed time: 00:03. -
Looks like a bug, I've reported it here: https://qt-project.atlassian.net/browse/QTBUG-145563
-
C Christian Ehrlicher referenced this topic