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. Question about SUBDIRS template in qmake
Forum Updated to NodeBB v4.3 + New Features

Question about SUBDIRS template in qmake

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 51 Views 2 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.
  • R Offline
    R Offline
    Robert Hairgrove
    wrote last edited by Robert Hairgrove
    #1

    Building with qmakeon Linux 24.04 with g++/ Qt 6.9.3 and MSVC on Windows with the same Qt version and also qmake.

    I am developing a desktop app that depends on some third-party libraries which I am including in the project as source code. At the moment, everything works OK, but I would like to use something like SUBDIRS to manage the build process a bit more flexibly.

    For example, when I raise the warning level higher, my own code compiles fine, but I get several more warnings from the 3rd-party code which clutter up the compiler output window. What is the best way of doing this?

    At the moment, here is my directory structure:

    Project
      |__app
           |__include
           |__src
           |__qrc
           |__forms
           |__translations
      |__3rd_party
           |__subproject1
           |__subproject2
           |__subproject3
      |__build
           |__${QT_VERSION}
              |__Debug
                   |__.moc
                   |__.obj
                   |__.qrc
                   |__.ui
              |__Release
                   |__.moc
                   |__.obj
                   |__.qrc
                   |__.ui
    

    Ideally, I would use a SUBDIRS template, and each of the .pro files under the 3rd_party folder would specify default warnings (-Wall -Wextra on Linux with GCC, /W3 on MSVC) but then I could have /W4 or -pedantic-errors in the main .pro file configuration.

    However, if I understand correctly, I need a TARGET directive for each of the subprojects, while all I need to do is to get them to compile and have their object files dumped in the same .obj folder used by the main app.

    What is the best way to approach this? Should I compile the 3rd-party code into static libraries and link them instead of what I am doing?

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

      Hi,

      Subdirs project are full-blown so your original idea won't work. The static libraries is the correct option.

      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

      • Login

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