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. Qmake, subdirs, libraries

Qmake, subdirs, libraries

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 2 Posters 1.7k Views
  • 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.
  • L Offline
    L Offline
    Lindley
    wrote on last edited by
    #1

    I'm trying to figure out if there's a good way to improve my qmake build, which right now has some issues.

    I have several repositories, each of which builds either a library or an executable. Each of them has a corresponding .pro file. What I would ideally like to do is tell an executable-making .pro which library-making .pro files it depends on.

    I tried setting "project dependencies" in my QTCreator session. That helped somewhat but didn't really solve the issue. Next, I tried explicitly adding the build directory and target of each library-making pro to the LIBS variable of the executable-making pro. This allowed the build to work.

    However, there's still an issue. If I modify a file in one of the libraries, the executable is not automatically re-linked as it should be.

    I have read about the SUBDIRS template in qmake. I have my doubts that this is what I want. I don't fully understand it---is there comprehensive documentation somewhere? But it seems like it's not quite what I need, because I want to be able to have multiple executables all depending on the same libraries, and it's not clear if SUBDIRS allows this.

    Any thoughts?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Subdirs is just a template that allows you to have several separate .pro files bundled together: you run qmake once for the root .pro file, and the rest is built automatically.

      For a huge example, simply check out Qt code: all modules are based on qmake SUBDIRS. For a smaller example, take a look at my "QEasyShell":https://github.com/sierdzio/qeasyshell.

      If you want other projects be rebuilt when you update a dependency, you need to use DEPENDPATH variable.

      (Z(:^

      1 Reply Last reply
      0

      • Login

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