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

[Reg 6.9.1 -> 6.10.0b2][CMake] Most private modules are no longer accessible

    XMLWordPrintable

Details

    • add3cf938 (dev), 0958c8943 (6.10)

    Description

      See the attached example. The qmake project still builds and runs fine in Qt 6.10.0-beta2, but the CMake project fails to configure:

      [cmake] CMake Error at CMakeLists.txt:12 (target_link_libraries):
      [cmake]   Target "appPrivateModuleTest" links to:
      [cmake] 
      [cmake]     Qt6::GuiPrivate
      [cmake] 
      [cmake]   but the target was not found.  Possible reasons include:
      [cmake] 
      [cmake]     * There is a typo in the target name.
      [cmake]     * A find_package call is missing for an IMPORTED target.
      [cmake]     * An ALIAS target is missing.
      

      Qt6::CorePrivate can still be used, but the others cannot, even though C:\Qt\6.10.0\msvc2022_64\lib\cmake\Qt6GuiPrivate et al. exist.

       

      Code
      CMakeLists.txt:

      target_link_libraries(appPrivateModuleTest PRIVATE
          Qt6::CorePrivate
          Qt6::GuiPrivate
          Qt6::QmlPrivate
          Qt6::QuickPrivate
      )
      

       

      *.pro:

      QT += core-private gui-private qml-private quick-private
      SOURCES += main.cpp
      

       

      main.cpp:

      #include <QDebug>
      #include <private/qmetaobjectbuilder_p.h> // core-private
      #include <private/qimage_p.h>             // gui-private
      #include <private/qqmlbuiltins_p.h>       // qml-private
      #include <private/qquickpalette_p.h>      // quick-private
      
      int main()
      {
           qDebug() << sizeof(QMetaObjectBuilder);
           qDebug() << sizeof(QImageData);
           qDebug() << sizeof(QQmlIntForeign);
           qDebug() << sizeof(QQuickPalette);
      }
      

      Attachments

        1. PrivateModuleTest.zip
          0.9 kB
        2. cmake_trace.zip
          377 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtbuildsystem Qt Build System Team
            skoh-qt Sze Howe Koh
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes