Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QBS: Debug output
Forum Updated to NodeBB v4.3 + New Features

QBS: Debug output

Scheduled Pinned Locked Moved Qt Creator and other tools
8 Posts 2 Posters 4.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jorj
    wrote on 9 Sept 2013, 18:53 last edited by
    #1

    Does QBS have any way to output XML (or makefile, or any kind of readable format) data for what it has decided to do?

    I am trying to port some existing libraries over to QBS... And am finding the lack of any kind of debugging a problem...

    I have two libraries, one depends on the other, the first library exports some include paths. These exported paths don't seem to be picked up in the second library... but I have no idea why (if i set cpp.includedPaths in the second library does it override the Export { ... } data??)

    I notice there is something called the QBS shell in the docs... but cant quite work out how to use it - the docs just suggest using "qbs shell" then i get a prompt with no help.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kandeler
      wrote on 11 Sept 2013, 14:50 last edited by
      #2

      Hi,

      you need to merge the lists:
      cpp.includePaths: base.includePaths.concat([...])
      "base" always refers to the inherited value of the module property on the left-hand side.
      Regarding debugging output, you can get it via the "-v" switch (use twice for even more information). It's probably not of too much use to users, I think (as opposed to qbs developers).
      "qbs shell" just gives you a shell with a product-specific environment.

      Christian

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jorj
        wrote on 11 Sept 2013, 18:35 last edited by
        #3

        thanks, ill have a go with this tonight

        1 Reply Last reply
        0
        • J Offline
          J Offline
          jorj
          wrote on 11 Sept 2013, 21:02 last edited by
          #4

          Hmm...

          I put together a test case:
          https://dl.dropboxusercontent.com/u/28029790/test.zip

          in summary:

          A/a.qbs:
          @
          DynamicLibrary {
          Depends { name: "cpp" }

          cpp.includePaths: [ "." ]
          files: [ "*.h" ]
          
          Export {
              cpp.includePaths: [ "." ]
          }
          

          }
          @

          B/b.qbs
          @
          DynamicLibrary {
          Depends { name: "cpp" }

          Depends { name: "A" }
          
          cpp.includePaths: base.concat( [ "." ] )
          
          files: [ "./*.cpp" ]
          

          }
          @

          C.qbs
          @
          Project {
          references: [
          "A/A.qbs",
          "B/B.qbs"
          ]
          }
          @

          The compile string that ends up being used (and failing), is

          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\amd64/cl.exe /nologo /c /EHsc /O2 /MD /IC:\Users\Jorj\project\test\B /DNDEBUG /DUNICODE /D_UNICODE /FoC:\Users\Jorj\project\C-build\qtc_Qt_5_0_2_msvc2012_64-release.obj\B\Pork.cpp.obj C:\Users\Jorj\project\test\B\Pork.cpp

          which only contains the include path for the descendant library...

          (i also tried absolute paths for the includePaths - it didnt seem to help, even though i don't think it is required?)

          I have tried poking around in the qbs source, but got lost when trying to trace where "modules", come from, in order to bake them into the include path list...

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kandeler
            wrote on 18 Sept 2013, 13:09 last edited by
            #5

            Don't use "." in the Export item, it will be interpreted at the point of import. Say "cpp.includePaths: [path]" instead, which refers to the directory the project file is in.

            1 Reply Last reply
            0
            • J Offline
              J Offline
              jorj
              wrote on 18 Sept 2013, 18:13 last edited by
              #6

              Ah ok, ill have another go...

              I think i copied this from an example... possibly here:

              http://doc-snapshot.qt-project.org/qbs/export-item.html

              Is there an example/unit test using Export items? if not can i submit one?

              1 Reply Last reply
              0
              • K Offline
                K Offline
                kandeler
                wrote on 19 Sept 2013, 08:26 last edited by
                #7

                Taking a second look, the problem could also be a missing cpp dependency in the Export item; i.e. if you use cpp properties there, you also have to add the respective Depends item. There are currently insufficient checks in some contexts, so it could be that without the Depends item, the property binding is silently ignored (instead of an error being raised).

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  jorj
                  wrote on 20 Sept 2013, 08:15 last edited by
                  #8

                  Yes, that works great!

                  So, i changed A/A.qbs to:
                  @
                  DynamicLibrary {

                  cpp.includePaths: [ "." ]
                  files: [ "*.h" ]
                  
                  Export {
                      Depends { name: "cpp" }
                      cpp.includePaths: [ "." ]
                  }
                  

                  }
                  @

                  And both include paths come through,

                  Thanks!

                  1 Reply Last reply
                  0

                  1/8

                  9 Sept 2013, 18:53

                  • Login

                  • Login or register to search.
                  1 out of 8
                  • First post
                    1/8
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved