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

set qmake config via environment variables

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Invalid
    • Affects Version/s: 6.2.1
    • Fix Version/s: None
    • Component/s: Build tools: qmake
    • Labels:
      None

      Description

      i am trying to override QT_INSTALL_HEADERS with

      qmake -set QT_INSTALL_HEADERS /custom/path/to/qt/include
      

      but

      qmake -query QT_INSTALL_HEADERS
      

      is still returning the default path

      the default path is set in qtbase/qmake/qmakelibraryinfo.cpp

      result = QLibraryInfo::path(static_cast<QLibraryInfo::LibraryPath>(loc));
      

      which is $prefix + "/include"

      my patch allows me to override qmake variables by setting environment variables

      export QT_INSTALL_HEADERS=/custom/path/to/qt/include
      qmake -query QT_INSTALL_HEADERS
      

      returns /custom/path/to/qt/include

      setting a custom include path is needed in "exotic" linux distros like nixos linux or guix linux,
      where qt libraries and qt headers can be in separate packages

      for example

      QT_INSTALL_PREFIX
      /nix/store/36drd4c9gl0qs3mjjrx0c9klfx5nppv6-qtbase-6.2.1
      
      QT_INSTALL_HEADERS
      /nix/store/0jn9mafzpjgz3pza9fwvfxvgpfaj2y82-qtbase-6.2.1-dev/include
      

      sample use of my patch in nixos
      https://github.com/NixOS/nixpkgs/pull/141883/commits/fe75dce13582e3672606615ee63eb21ecf168dca

      to fix the include path, i use

      wrapProgram $dev/bin/qmake \
            --set QT_INSTALL_HEADERS $dev/include
      

        Attachments

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

          Activity

            People

            Assignee:
            qtbuildsystem Qt Build System Team
            Reporter:
            milahu milan hauth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes