Priority: P2: Important
Affects Version/s: 6.0
Fix Version/s: None
Component/s: Build System: CMake
Referenced snapshots: 1(June 15th), 2(June 25th), 3(6.0.0-202008280958, August 28th)
The basic app example(created to see how to solve the dependencies issue),
ok for Qt 6.0.0 public snapshot 1, broken on snapshots 2 && 3:
In Qt 5, XCB dependencies would be compiled from internal sources(`qtbase`), thus avoiding to propagate that dependency to the user.
In Qt 6, there seems to be a regression and the user has to install the following dependencies(Ubuntu/Debian example) in order to compile the basic example app:
Qt 6.0.0 public snapshot 1:
Qt 6.0.0 public snapshots 2 && 3:
"libgl1-mesa-dev" was also required for Qt 5(after installing it, to create any GUI, you would need to install that dependency manually) - I think that is somewhat accepted now(expecting the same situation to be for `libvulkan-dev` but not for XCB which is available inside `qtbase`).
After installing Qt 6 and manually tracking and installing all of these dependencies(my guess is it that other modules would require more dependencies tracking), the user hits the CMake target issues:
- The targets cannot find other targets on which these depend, ex:
Qt::Quick cannot find Qt::OpenGL and XKB::XKB or Qt::Quick cannot find Qt::Qml without Qt::QmlModels
Usually a config file searches for it's own targets, in this example, QtQuickConfig.cmake would run `find_dependency(QtOpenGL)`(not sure if this is the exact config) and find it's own `Qt::OpenGL` target, not forcing the user to do the manual tracking of the dependencies.
- Some targets should use `target_link_libraries(... PRIVATE ...)` to hide the internal dependencies and not expose the details to the user: XKB::XKB is not exposed to the user through the public API, thus, this should be linked using the "PRIVATE" keyword.
The final solution to compile the basic QML app on Linux(Ubuntu/Debian), on August 28th snapshot, looks like this:
Additional Ubuntu dependencies required to be installed by the client:
CMake file for the QML app: