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. [Solved] Custom Build Process
Forum Update on Monday, May 27th 2025

[Solved] Custom Build Process

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.3k 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
    Luthais
    wrote on 2 Jun 2014, 21:47 last edited by
    #1

    I am new to Qt and evaluating it to possibly switch over from VS. However, I am having trouble setting up my project and could use some help.

    I have a chain of static libraries that depend on one another. At some point in the chain it branches into two parallel sets of libraries (client/server). Here is a simplified overview of my setup:

    Utilities --> MetaData --> Networking --> Common --> Client
    Utilities --> MetaData --> Networking --> Common --> Server

    So I have two issues:

    1. When building the subdirs project, I need the Common subproject to be built twice, each time with a different preprocessor define, a different build directory, and a different output file. Maintaining two projects that are otherwise identical has historically been way too much of a pain.
    2. Since all of these subprojects depend on one another I need to make sure the build order is as listed above.

    This project is being worked on by a small team, so I would like a minimal amount of custom setup/configuration needed per machine. I would also like to keep both Client and Server subprojects under the same subdirs project if possible, as it makes it much easier to work on both in parallel.

    I accomplished the first task above in VS by creating custom build configurations and it works flawlessly for what I need. My limited knowledge of makefiles and Qt Creator suggests this would not be the best approach here.

    Any help would be greatly appreciated! Apologies if this is already covered elsewhere. I assume it probably is but for the life of me I could not find anything after a few days of searching and experimenting.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 3 Jun 2014, 08:22 last edited by
      #2

      Hi and welcome to devnet,

      If you are using qmake you should have a look at the subdir template which does what are looking after. You can even tell it the order of compilation of the sub-project.

      If Common must be build twice then it should rather use a pri file included by Client.pro and Server.pro with the specific options set there.

      Hope it helps

      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
      • L Offline
        L Offline
        Luthais
        wrote on 4 Jun 2014, 20:24 last edited by
        #3

        Thank you much.

        As you suggested, the use of .pri files did indeed resolve my issues. I just removed the Common.lib entirely and built the entire set of files directly into both Client and Server projects, while still keeping it separate from both.

        Sorry for the delayed response, the past few days have been something of a crash course for me. A decade of using MSVC/XCode exclusively has not left me with the need to mess with makefiles and whatnot. The number of things I had to learn coupled with fixing code that was not GCC compliant kept me pretty busy. The need to link libraries in reverse dependency order was particularly frustrating.

        Thanks again!

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 4 Jun 2014, 20:52 last edited by
          #4

          You're welcome !

          Since your project is building now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

          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

          1/4

          2 Jun 2014, 21:47

          • Login

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