Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Building a subdirs project
QtWS25 Last Chance

Building a subdirs project

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 970 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.
  • bedehoB Offline
    bedehoB Offline
    bedeho
    wrote on last edited by
    #1

    I have a project which is organzed as follows

    project.pro

    • lib.pro
    • app.pro

    project.pro:

    TEMPLATE = subdirs
    SUBDIRS =
    lib
    app
    app.depends = lib

    lib.pro

    TARGET = MyLib
    TEMPLATE = lib
    CONFIG += staticlib
    CONFIG += create_prl # Following http://qt-project.org/doc/qt-5/qmake-advanced-usage.html

    app.pro:

    TARGET = MyApp
    TEMPLATE = app
    CONFIG += link_prl # Following http://qt-project.org/doc/qt-5/qmake-advanced-usage.html

    Problem

    If I make a change in the lib source, then I find that if I build the project (by pressing the hammer in QtCreator), then the changes do not actually show up in the program that runs. If I try to build by just pressing Run or Start Debugging, I get the same effect. MyApp is the only build target I can choose from the Computer icon in QtCreator. As a result I actually have to Rebuild (by right clicking on root node in the Project explorer tree), which takes ages every time, however small the change I make.

    How can I get QtCreator to only build the small parts of my project where a change occurs?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      IIRC, you need to use PRE_TARGETDEPS in your app.pro to tell the system to watch for changes in your static library

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • bedehoB Offline
        bedehoB Offline
        bedeho
        wrote on last edited by
        #3

        @SGaist said:

        PRE_TARGETDEPS

        That seems to have done it, thanks!!!

        1 Reply Last reply
        0
        • D Offline
          D Offline
          DRoscoe
          wrote on last edited by
          #4

          I recently resolved a boatload of issues like this in my project, and I found that if you use the wizard to add an internal library, pointing to your dependent library, all of the necessary bookkeeping is done for you. I then took the resulting auto-generated code and created a .pri file. Then instead of using the wizard all the time, I just include the .pri file and all of the paths etc. are taken care of.

          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