Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-89714

CMake cannot separately build sqldrivers

    XMLWordPrintable

Details

    • 2491c4745899f1cf91838cd16a9d88ff97e8a02b (qt/qtbase/6.0) 173f163ad21835c9cf514f601b72034777ff1b19 (qt/qtbase/dev)

    Description

      I use prebuilt Qt 6.0.0 to build mysql plugin,  but fail.

      D:\Qt\build>qt-cmake-private D:\Qt\src\qt6\qtbase\src\plugins\sqldrivers -DMySQL_INCLUDE_DIRS=%MYSQL_PREFIX%\include -DMySQL_LIBRARIES=%MYSQL_PREFIX%\lib\libmysql.lib
      -- The CXX compiler identification is MSVC 19.28.29335.0
      -- The C compiler identification is MSVC 19.28.29335.0
      -- The ASM compiler identification is MSVC
      -- Found assembler: D:/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: D:/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: D:/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Looking for pthread.h
      -- Looking for pthread.h - not found
      -- Found Threads: TRUE
      -- Performing Test HAVE_STDATOMIC
      -- Performing Test HAVE_STDATOMIC - Success
      -- Found WrapAtomic: TRUE
      -- Could NOT find DB2 (missing: DB2_INCLUDE_DIRS DB2_LIBRARIES)
      -- Found MySQL: D:/mysql-5.7.31-winx64/lib/libmysql.lib
      -- Could NOT find PostgreSQL (missing: PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR)
      -- Could NOT find Oracle (missing: Oracle_INCLUDE_DIRS Oracle_LIBRARIES)
      -- Found ODBC: odbc32.lib
      -- Could NOT find SQLite3 (missing: SQLite3_INCLUDE_DIR SQLite3_LIBRARY)
      CMake Error at D:/Qt/6.0.0/msvc2019_64/lib/cmake/Qt6/QtPluginHelpers.cmake:153 (add_dependencies):
        Cannot add target-level dependencies to non-existent target "qt_plugins".  The add_dependencies works for top-level logical targets created by the
        add_executable, add_library, or add_custom_target commands.  If you want to
        add file-level dependencies see the DEPENDS option of the add_custom_target
        and add_custom_command commands.
      Call Stack (most recent call first):
        mysql/CMakeLists.txt:7 (qt_internal_add_plugin)
      CMake Error at D:/Qt/6.0.0/msvc2019_64/lib/cmake/Qt6/QtPluginHelpers.cmake:153 (add_dependencies):
        Cannot add target-level dependencies to non-existent target "qt_plugins".  The add_dependencies works for top-level logical targets created by the
        add_executable, add_library, or add_custom_target commands.  If you want to
        add file-level dependencies see the DEPENDS option of the add_custom_target
        and add_custom_command commands.
      Call Stack (most recent call first):
        odbc/CMakeLists.txt:9 (qt_internal_add_plugin)
      CMake Error at D:/Qt/6.0.0/msvc2019_64/lib/cmake/Qt6/QtPluginHelpers.cmake:153 (add_dependencies):
        Cannot add target-level dependencies to non-existent target "qt_plugins".  The add_dependencies works for top-level logical targets created by the
        add_executable, add_library, or add_custom_target commands.  If you want to
        add file-level dependencies see the DEPENDS option of the add_custom_target
        and add_custom_command commands.
      Call Stack (most recent call first):
        sqlite/CMakeLists.txt:7 (qt_internal_add_plugin)
      -- Configuring incomplete, errors occurred!
      See also "D:/Qt/build/CMakeFiles/CMakeOutput.log".
      See also "D:/Qt/build/CMakeFiles/CMakeError.log".
      

      So I have to run:

      cmake D:\Qt\src\qt6\qtbase -GNinja -DCMAKE_BUILD_TYPE=Release -DMySQL_INCLUDE_DIRS=%MYSQL_PREFIX%\include -DMySQL_LIBRARIES=%MYSQL_PREFIX%\lib\libmysql.lib
      ninja src/plugins/sqldrivers/mysql/all

      QtCore, QtSql, etc.  will also be built, which costs much time.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtbuildsystem Qt Build System Team
            lixinwei Li Xinwei
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes