Menu

#353 Generated pkgconfig file for Qt6 requires Qt5 libs

None
closed
nobody
None
5
2025-05-22
2022-05-24
No

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

Discussion

  • Mehdi Chinoune

    Mehdi Chinoune - 2022-05-24

    There is no pkgconfig files for Qt6, so the suggested patch is:

    --- a/src/src.pro
    +++ b/src/src.pro
    @@ -82,14 +82,16 @@
         greaterThan(QT_MAJOR_VERSION, 4) {
    
             QMAKE_PKGCONFIG_FILE = Qt$${QT_MAJOR_VERSION}$${QMAKE_PKGCONFIG_NAME}
    
    -        QMAKE_PKGCONFIG_REQUIRES = Qt5Widgets Qt5Concurrent Qt5PrintSupport
    +        lessThan( QT_MAJOR_VERSION, 6) {
    +           QMAKE_PKGCONFIG_REQUIRES = Qt5Widgets Qt5Concurrent Qt5PrintSupport
    
    
    -        contains(QWT_CONFIG, QwtSvg) {
    -            QMAKE_PKGCONFIG_REQUIRES += Qt5Svg
    -        }
    +           contains(QWT_CONFIG, QwtSvg) {
    +               QMAKE_PKGCONFIG_REQUIRES += Qt5Svg
    +           }
    
    
    -        contains(QWT_CONFIG, QwtOpenGL) {
    -            QMAKE_PKGCONFIG_REQUIRES += Qt5OpenGL
    -        }
    +           contains(QWT_CONFIG, QwtOpenGL) {
    +               QMAKE_PKGCONFIG_REQUIRES += Qt5OpenGL
    +           }
    +       }
    
             QMAKE_DISTCLEAN += $${DESTDIR}/$${QMAKE_PKGCONFIG_DESTDIR}/$${QMAKE_PKGCONFIG_FILE}.pc
         }
    
     
  • Mehdi Chinoune

    Mehdi Chinoune - 2022-05-24

    The best solution is to move to CMake and generate cmake-config files.

     
    • Anonymous

      Anonymous - 2022-05-24

      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.

       
      • Mehdi Chinoune

        Mehdi Chinoune - 2022-05-24

        Anyone using Qwt is using Qt, There is no *.pc for Qt6 libs which means you have only two options:

        1- Use *.prf files with qmake
        2- 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.

         
  • Uwe Rathmann

    Uwe Rathmann - 2022-12-12
    • status: open --> wont-fix
    • Group: -->
     
  • Mehdi Chinoune

    Mehdi Chinoune - 2022-12-13

    The bug wasn't fixed, so why It was closed?

     
  • Uwe Rathmann

    Uwe Rathmann - 2022-12-13
    • status: wont-fix --> open
     
  • Chris Webster

    Chris Webster - 2024-12-29

    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
  • Justin Arthur

    Justin Arthur - 2025-05-21

    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.

     
  • Uwe Rathmann

    Uwe Rathmann - 2025-05-22
     
  • Uwe Rathmann

    Uwe Rathmann - 2025-05-22
    • status: open --> closed
     
    🎉
    1

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB