1

I am trying to modify the install dir in qbs. I tried every possibility, which came in my mind. I would like to install to the location of an env var... but qbs always installs into a subdir in the dir where it was stated in (e.g. qtc_Desktop__0e446cd2-debug) I tried combinations of:

qbs.install: true
qbs.installDir: project.defaultLibInstallDir
qbs.installPrefix: project.defaultLibInstallPrefix
qbs.installRoot: project.defaultInstallRoot

I really like qbs, but can't figure out how the install should be used correctly. I would appreciate an example, how an install to different system paths work (e.g. /usr/local/bin and /usr/local/include)

Update:

DynamicLibrary {
    name: "software"
    files: ["src/*.cpp", "src/*.hpp"]

    Depends { name: "cpp" }

    Group {
        fileTagsFilter: product.type
        qbs.install: true
        qbs.installDir: "lib"
        qbs.installPrefix: "/home/userName/someDir"
    }
}
Jake Petroules
  • 23,472
  • 35
  • 144
  • 225

1 Answers1

2

The install properties in qbs are documented here:

I'll also give a few examples of each and how you might use it:

  • qbs.installDir: Relative to qbs.installPrefix. This might typically be something like "bin" or "lib" or "share" in your install Groups, depending on the content that Group is installing.

  • qbs.installPrefix: The prefix on the target system at which your tree is installed. This might be something like "/usr" or "/usr/local".

  • qbs.installRoot: This is an external property which is prepended to all installation paths in your project. You do not set it within your project, only on the qbs command line. It defaults to a temporary location within your build directory. For example, if you set qbs.installPrefix to "/usr" and actually want your file tree to get installed there, you'll set qbs.installRoot to "/". Otherwise, your entire installation tree gets rooted within the qbs.installRoot. For example, if you were using qbs to build a Debian or RPM package, you'd set qbs.installRoot to the location of the temporary root used by the build process.

Jake Petroules
  • 23,472
  • 35
  • 144
  • 225
  • Thanks for the answer! Unfortunately, I don't get it right.. I updated my question with the code I'm using. I do the call `sudo qbs -d "/"` and I get everything under `/qt-debug/install-root/home/userName/someDir/lib`. Furthermore its not optimal that the user needs to `sudo` because the build dir lies under `/`... What did I do wrong? Thanks –  Apr 03 '16 at 10:32
  • 1
    -d specifies your build directory; don't try to use that for installation. Secondly, qbs.installPrefix should not have "/home/userName/someDir", instead you should run `qbs install --install-root /home/userName/someDir` – Jake Petroules Apr 03 '16 at 23:33
  • That works. thank you so much :) If you integrate this comment into the answer, I ll mark it as solved! –  Apr 04 '16 at 17:04