mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-01 00:54:13 +02:00
Request the GuiPrivate component only on Qt6
Listing GuiPrivate unconditionally in QET_COMPONENTS breaks the whole Qt5 configure: find_package(Qt5 COMPONENTS GuiPrivate) looks for a Qt5GuiPrivateConfig.cmake that has never existed - Qt5 creates the Qt5::GuiPrivate target implicitly together with Gui. Only Qt6 requires (and provides) the explicit component. Move the request into a QT_VERSION_MAJOR-guarded find_package after the main one, both for the application and for tests/catch (whose targets link Qt::GuiPrivate via QET_PRIVATE_LIBRARIES). Fixes the msys2/Qt5 Windows CI configure failure: "Could not find a package configuration file provided by Qt5GuiPrivate". Verified: Qt 6.11 configure passes and the Qt6::GuiPrivate target is created (the private-module warning now fires from the guarded call). The Qt5 path simply no longer requests the component, restoring the pre-existing implicit behaviour.
This commit is contained in:
@@ -78,6 +78,14 @@ find_package(
|
||||
${QET_COMPONENTS}
|
||||
REQUIRED)
|
||||
|
||||
# Qt6 only creates the Qt::GuiPrivate target (used for QPdfEngine::drawHyperlink)
|
||||
# when the GuiPrivate component is explicitly requested. Qt5 has no such
|
||||
# component package and creates the target implicitly with Gui, so only
|
||||
# request it on Qt6 - requesting it on Qt5 fails the whole configure.
|
||||
if(QT_VERSION_MAJOR GREATER_EQUAL 6)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS GuiPrivate)
|
||||
endif()
|
||||
|
||||
find_package(SQLite3 REQUIRED)
|
||||
|
||||
set(CMAKE_AUTOUIC_SEARCH_PATHS ${QET_DIR}/sources/ui)
|
||||
|
||||
Reference in New Issue
Block a user