Important: Please read the Qt Code of Conduct -

How to divide a project into submodules?

  • I'm working on a project which is currently comprised of two static libraries, a GUI application and a command line. The project is organized as a subdirs project that defines dependencies between the library modules, command line application and GUI application. As the GUI application grew, a couple of its components started to increase in size and complexity. I would like to move those components into independent submodules of the GUI project, preferably as static libraries. Yet, as those components are only used by the GUI application I want to avoid moving them out of the GUI project and next to the library modules. Does anyone know if there is a way to organize a project tree so that a GUI project includes submodules in its subdirectories?

  • Lifetime Qt Champion

    Do you mean like Creators source where most things are plugins and have their own .pri file and its just included in the master .pro file?

    • so that a GUI project includes submodules in its subdirectories?
      If a submodule in this context could be a complete sub project using a .pri file and not a .pro file then yes.
      But im not sure i understand fully what you need.

  • Lifetime Qt Champion


    You can make you GUI project a subdir project the same way you did for the rest of the project.

    Take for example Qt's own sources, these are mainly subdir projects within subdir projects.

Log in to reply