Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-89989

Qt 6 cmake build does not see user-provided bzip2, breaks freetype2 (and eventually gtk3)

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 6.0.0
    • Build System: CMake
    • None
    • Linux/X11

    Description

      I'm building Qt 6 with cmake (not using the configure script) on Ubuntu 20.04 x86_64. When I try to enable `gtk3` support with option `-DFEATURE_gtk3=ON` then cmake fails with error:

      -- Checking for module 'gtk+-3.0 >= 3.6'
      --   Package 'bzip2', required by 'freetype2', not found
      CMake Error at qtbase/cmake/QtFeature.cmake:207 (message):
        Feature "gtk3": Forcing to "ON" breaks its condition.
      Call Stack (most recent call first):
        qtbase/cmake/QtFeature.cmake:288 (qt_feature_set_value)
        qtbase/cmake/QtFeature.cmake:474 (qt_evaluate_feature)
        qtbase/cmake/QtModuleHelpers.cmake:397 (qt_feature_module_end)
        qtbase/src/widgets/CMakeLists.txt:7 (qt_internal_add_module)
      

      I have freetype2 and bzip2 installed (as shared libraries, with a cmake-based build) in `PREFIX`, with package configurations in:

      PREFIX/lib/cmake/bzip2/
      PREFIX/lib/pkgconfig/bzip2.pc
      PREFIX/lib/cmake/freetype
      PREFIX/lib/pkgconfig/freetype2.pc
      

      The path to PREFIX is passed to cmake via

      -DCMAKE_PREFIX_PATH="PREFIX;PREFIX/lib/cmake"
      

      This generally works with Qt to find our other dependencies (like libtiff, zlib, png, and many others). Also, bzip2 is found in other cmake builds like OpenCV or BioImageConvert, so I assume that the installation is correct.

      It seems to fail only for bzip2 as a dependency of freetype2 for Qt?

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtbuildsystem Qt Build System Team
            emmenlau Mario Emmenlauer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes