mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-07-29 22:54:12 +02:00
qmake: allow building without KDE Frameworks 5 (CONFIG+=no_kf5)
The CMake build has supported building without KF5 since the Qt-only
replacements landed in sources/ui/nokde (BUILD_WITH_KF5=OFF). The qmake
build had no equivalent: qelectrotech.pro hard-coded
QT += ... KWidgetsAddons KCoreAddons ...
so a machine without KF5 fails at configure time with
Project ERROR: Unknown module(s) in QT: KWidgetsAddons KCoreAddons
This is the error reported in discussion #393, where a contributor gave up
trying to build on Windows with Qt 5.15.2 / MinGW. Deleting the two modules
by hand (the obvious workaround) then fails at link time with undefined
references to KAutoSaveFile, because the nokde sources are never compiled.
Mirror the four things CMake does when BUILD_WITH_KF5=OFF:
- define BUILD_WITHOUT_KF5 (the sources already guard on it)
- add sources/ui/nokde to INCLUDEPATH
- compile the three nokde replacements (KAutoSaveFile, KColorButton,
KColorCombo)
- drop KWidgetsAddons/KCoreAddons from QT
The default build is unchanged: without CONFIG+=no_kf5 the KF5 modules are
still required and sources/ui/nokde is not on the include path.
Usage:
qmake CONFIG+=no_kf5 qelectrotech.pro
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+20
-1
@@ -238,7 +238,26 @@ RESOURCES += qelectrotech.qrc
|
|||||||
TRANSLATIONS += lang/*.ts
|
TRANSLATIONS += lang/*.ts
|
||||||
|
|
||||||
# Modules Qt utilises par l'application
|
# Modules Qt utilises par l'application
|
||||||
QT += xml svg network sql widgets printsupport concurrent KWidgetsAddons KCoreAddons gui-private
|
QT += xml svg network sql widgets printsupport concurrent gui-private
|
||||||
|
|
||||||
|
# KDE Frameworks 5 (KWidgetsAddons, KCoreAddons) are optional.
|
||||||
|
#
|
||||||
|
# Pass CONFIG+=no_kf5 to qmake to build against the Qt-only replacements in
|
||||||
|
# sources/ui/nokde instead. This mirrors the CMake option BUILD_WITH_KF5=OFF
|
||||||
|
# and is the easiest route on Windows/MinGW, where KF5 is awkward to obtain.
|
||||||
|
#
|
||||||
|
# qmake CONFIG+=no_kf5 qelectrotech.pro
|
||||||
|
#
|
||||||
|
# sources/ui/nokde is only added to the include path in that configuration, so
|
||||||
|
# a normal KF5 build is unaffected.
|
||||||
|
no_kf5 {
|
||||||
|
DEFINES += BUILD_WITHOUT_KF5
|
||||||
|
INCLUDEPATH += sources/ui/nokde
|
||||||
|
HEADERS += $$files(sources/ui/nokde/*.h)
|
||||||
|
SOURCES += $$files(sources/ui/nokde/*.cpp)
|
||||||
|
} else {
|
||||||
|
QT += KWidgetsAddons KCoreAddons
|
||||||
|
}
|
||||||
|
|
||||||
# Private Qt GUI headers (needed for QPdfEngine::drawHyperlink)
|
# Private Qt GUI headers (needed for QPdfEngine::drawHyperlink)
|
||||||
# gui-private should add this automatically, but some distros need it explicit
|
# gui-private should add this automatically, but some distros need it explicit
|
||||||
|
|||||||
Reference in New Issue
Block a user