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

Unable to depend on a product from a custom module

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • None
    • 1.5.2
    • Documentation, General
    • None
    • fb52fed84 (master)

    Description

      This is related to QBS-916, which was closed without being fixed because the information needed was not supplied. I just hit the same issue with my project so I can add more context.

      In that project, I have a web application developed with AngularJS. The Qt application is a small C++ wrapper that use a WebEngine and a custom url scheme to show the bundled webapp from the resource files. In the real application, there are a lot of custom rules to install some packages with npm, install some dependencies with bower and build the resulting files with grunt and put them in a temporary directory. Then, I have an application that scan the directory and create a qrc file from a template.

      I made a small example from a subset of my qbs files. In that example, the main project file defines 2 products : the main product and a small tool that is used to generate the qrc file. There's also a module called "webapp" that is used to build the webapp and call the C++ tool (in the real application, this is a chain of custom modules).

      The problem is that the C++ tool may not exist before the webapp rule is started resulting in an "executable not found error". So to fix the problem, I need to make the tool a dependency of the module. In the official documentation, it is said that a Depends can be added on a Product and on a Module. Except that when the Depends is added on the Module, the following warnings are displayed (in Qt Creator) :
      :-1: warning: Can't find variable: product
      :-1: warning: Product 'mainapp' had errors and was disabled.

      Looking at the custom Rule, we can see that there are also a problem finding the tool executable path since I had to use an undocumented feature. That leads me to believe that it is not the right way to do this kind of thing, but the documentation of the Rule item properties is not really helpful (i.e. badly documented).

      Attachments

        1. project.qbs
          0.9 kB
          Mathieu Bouchard
        2. webapp.qbs
          0.9 kB
          Mathieu Bouchard

        Issue Links

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

          Activity

            People

              kandeler Christian Kandeler
              mbouchar@gmail.com Mathieu Bouchard
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes