Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
6.10.0 Beta2
-
Windows 10 22H2, CMake 3.30.5, MSVC 2022 x64
-
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); }