Generated pkgconfig file for Qt6 requires Qt5 libs
Brought to you by:
rathmann
This is the generated Qt6Qwt6.pc
prefix=/clang64
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include/qwt-qt6
Name: Qwt6
Description: Qt Widgets for Technical Applications
Version: 6.2.0
Libs: -L${libdir} -lqwt-qt6
Cflags: -I${includedir}
Requires: Qt5Widgets Qt5Concurrent Qt5PrintSupport Qt5Svg Qt5OpenGL
This is because of:
https://sourceforge.net/p/qwt/git/ci/develop/tree/src/src.pro#l85
suggested patch:
--- a/src/src.pro
+++ b/src/src.pro
@@ -82,14 +82,14 @@
greaterThan(QT_MAJOR_VERSION, 4) {
QMAKE_PKGCONFIG_FILE = Qt$${QT_MAJOR_VERSION}$${QMAKE_PKGCONFIG_NAME}
- QMAKE_PKGCONFIG_REQUIRES = Qt5Widgets Qt5Concurrent Qt5PrintSupport
+ QMAKE_PKGCONFIG_REQUIRES = Qt$${QT_MAJOR_VERSION}Widgets Qt$${QT_MAJOR_VERSION}Concurrent Qt$${QT_MAJOR_VERSION}PrintSupport
contains(QWT_CONFIG, QwtSvg) {
- QMAKE_PKGCONFIG_REQUIRES += Qt5Svg
+ QMAKE_PKGCONFIG_REQUIRES += Qt$${QT_MAJOR_VERSION}Svg
}
contains(QWT_CONFIG, QwtOpenGL) {
- QMAKE_PKGCONFIG_REQUIRES += Qt5OpenGL
+ QMAKE_PKGCONFIG_REQUIRES += Qt$${QT_MAJOR_VERSION}OpenGL
}
QMAKE_DISTCLEAN += $${DESTDIR}/$${QMAKE_PKGCONFIG_DESTDIR}/$${QMAKE_PKGCONFIG_FILE}.pc
Anonymous
There is no pkgconfig files for Qt6, so the suggested patch is:
The best solution is to move to CMake and generate cmake-config files.
Moving to cmake for Qwt does not mean, that applications using Qwt do the same. A cmake-config won't help anyone not using cmake - like qwt.prf does not help applications not using qmake. Something like pkgconfig - that can be processed by any build system - seems to be a good idea to me.
Anyone using Qwt is using Qt, There is no
*.pcfor Qt6 libs which means you have only two options:1- Use
*.prffiles with qmake2- Use cmake-config files with cmake.
It is going to be very difficult to adapt to any other build-system because you have to deduce all required compile flags, compile definitions and link flags. And you should also keep them updated with any new modifications on Qt.
Looks like Qt 6.4 will fix the missing pc files: https://bugreports.qt.io/browse/QTBUG-86080
The changes were merged https://codereview.qt-project.org/c/qt/qtbase/+/381127 and backported to both Qt 6.3.1 https://codereview.qt-project.org/c/qt/qtbase/+/405678 and 6.2 (Commercial LTS) https://codereview.qt-project.org/c/qt/qtbase/+/405679
The bug wasn't fixed, so why It was closed?
Qt6 does have pkg-config files, just not installed in the standard place. On my OSX build machine I have been using:
pkg-config --with-path=/usr/local/opt/qt/libexec/lib/pkgconfig --with-path=/usr/local/opt/qwt/lib/pkgconfig
until this gets straightened out. But I ran into the Qt6Qwt6.pc file being inaccurate. For now I have manually fixed the .pc file.
Last edit: Chris Webster 2024-12-30
With the upstream fixes for Qt6 supplying .pc files fixed for a couple years now, I think it's a fine time to merge either @mchinoune's patch in this ticket or @burghart's merge request. The patches approach it slightly differently in variable injection but the effect of either is the same.
See https://sourceforge.net/p/qwt/git/merge-requests/7/