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

qmake ignores FREETYPE_INCDIR, FREETYPE_LIBDIR and FREETYPE_LIBS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.12.2, 5.14.0 Alpha
    • 5.12.0
    • Build System
    • None
    • Linux/X11, Windows
    • fffe5d622549f85968ea0be9717b90cbc020be71 (qt/qtbase/5.12)

    Description

      When trying to build Qt with freetype like this

      configure (...) -system-freetype (...) "FREETYPE_INCDIR=/home/conan/.conan/data/freetype/2.9.0/bincrafters/stable/package/2529444d14934fc77cb61780d98aad96c0578c5c/include" "FREETYPE_LIBDIR=/home/conan/.conan/data/freetype/2.9.0/bincrafters/stable/package/2529444d14934fc77cb61780d98aad96c0578c5c/lib" "FREETYPE_LIBS=-lfreetype -lm"

      it fails with

      ERROR: Feature 'system-freetype' was enabled, but the pre-condition 'features.freetype && libs.freetype' failed.

      config.log has

      + cd /home/conan/.conan/data/qt/5.12.0/bincrafters/testing/build/d054c55689056d7eb9032e8a03268ee8a4abe0b4/config.tests/freetype && /home/conan/.conan/data/qt/5.12.0/bincrafters/testing/build/d054c55689056d7eb9032e8a03268ee8a4abe0b4/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared use_gold_linker warn_off console single_arch" 'QMAKE_USE += freetype' 'QMAKE_LIBS_FREETYPE = -lfreetype' /home/conan/.conan/data/qt/5.12.0/bincrafters/testing/build/d054c55689056d7eb9032e8a03268ee8a4abe0b4/config.tests/freetype
       + cd /home/conan/.conan/data/qt/5.12.0/bincrafters/testing/build/d054c55689056d7eb9032e8a03268ee8a4abe0b4/config.tests/freetype && MAKEFLAGS= /usr/bin/make
       > g++ -c -pipe -O2 -std=gnu+11 -w -fPIC -I. -I/home/conan/.conan/data/qt/5.12.0/bincrafters/testing/source/qt5/qtbase/mkspecs/linux-g+ -o main.o main.cpp
       > main.cpp:2:22: fatal error: ft2build.h: No such file or directory

      Why is FREETYPE_INCDIR not used for the test ?

       the problem is similar to what is described in https://stackoverflow.com/questions/53745257/building-qt-for-linux-x86-with-fontconfig-support

      Edit: passing the include directory via "-I ..." instead of "FREETYPE_INCDIR=..." solves the "fatal error: ft2build.h: No such file or directory", but after that linking fails, so FREETYPE_LIBDIR variable seem to be also ignored by qmake. Using "-L ..." instead of "FREETYPE_LIBDIR=..." solves the linking of the configuration test.
      Even with these two workarounds, the compilation of qt libs still fail because of missing symbols from bzip2, libpng and zlib. That should be solved by setting "FREETYPE_LIBS=-lfreetype -lbz2 -lpng16 -lz", but guess what, qmake also ignores FREETYPE_LIBS
      The use of these *_INCDIR, *_LIBDIR and *_LIBS variable works great for all other dependencies of Qt, I use it successfully for zlib, openssl, pcre2, sqlite3 etc. But for some reason, all these variables are not used for freetype

      Attachments

        For Gerrit Dashboard: QTBUG-72765
        # Subject Branch Project Status CR V

        Activity

          People

            jbornema Joerg Bornemann
            ericlemanissier Eric Lemanissier
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes