Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-1414

Generic way to find dependent libraries

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Configuration Probes
    • Labels:
      None

      Description

      As proposed in [1], it is nice to have a module that allow to find generic library in a system. Suggested names - ExternalModule, ExternalPackageModule, FindPackageModule (hello, cmake!).

      That module should try several ways of finding a package. For now, I can only think about PkgConfigProbe and IncludeProbe+LibraryProbe. And, of course, it should allow to fallback to user-specified paths.
      Should it support searching library within user project tree? IMO, no.

      Pkg-config works on both Linux and Mac (installed with homebrew to /usr/local).

      IncludeProbe is quite dumb now, there are ways to improve it.
      First, both IncludeProbe and LibraryProbe should respect qbs.sysroot property (aka sdkPath on Mac). In case it is present, they should look in sysroot/usr/, otherwise, in /usr/. Currently, only /usr/* is supported (via PathProbe).
      Second, LibraryProbe should do the following:
      On Mac, if sysroot is not present look at /usr/lib, than at /usr/local (homebrew), then at /opt/local (MacPorts). If sys root is present, only /usr should be used (because normally people won't install anything into the sdk as it is wiped with Xcode update).
      On Linux, if sysroot is not present, look at /usr/lib/xARCH-linux-gnu - (Debian case) and /usr/libARCH (lib64 or lib32). Then check for architecture - if host.arch == target.arch, look at /usr/lib.
      What about arm?
      On windows... Dunno about windows... Check for Visual Studio install dir? For c:\windows\system32?

      Did I missed something?

      [1] https://codereview.qt-project.org/#/c/186685/1/share/qbs/imports/qbs/base/PkgConfigModule.qbs

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              kandeler Christian Kandeler
              Reporter:
              arch Ivan Komissarov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes