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. subdirs with more than one level
Forum Updated to NodeBB v4.3 + New Features

subdirs with more than one level

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 3 Posters 1.1k 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.
  • A Offline
    A Offline
    aethelnorn
    wrote on last edited by
    #1

    I am trying to construct a project file. I can see the logic of the subdirs template, but the docs only seem to describe a simple case where the app depends upon lib and lib2.

    TEMPLATE = subdirs
    SUBDIRS =
    lib2 \ # sub-project names
    lib
    app
    lib2.subdir = src/lib2
    lib.subdir = src/lib
    app.subdir = src/app
    app.depends = lib lib2

    What if app depends on lib and lib depends upon lib1 and lib2? Do I add the line in bold

    TEMPLATE = subdirs
    SUBDIRS =
    lib2 \
    lib1 \
    lib
    app
    lib1.subdir = src/lib1
    lib2.subdir = src/lib2
    lib.subdir = src/lib
    app.subdir = src/app
    app.depends = lib lib2
    lib.depends = lib1 lib2

    A aha_1980A 2 Replies Last reply
    0
    • A aethelnorn

      I am trying to construct a project file. I can see the logic of the subdirs template, but the docs only seem to describe a simple case where the app depends upon lib and lib2.

      TEMPLATE = subdirs
      SUBDIRS =
      lib2 \ # sub-project names
      lib
      app
      lib2.subdir = src/lib2
      lib.subdir = src/lib
      app.subdir = src/app
      app.depends = lib lib2

      What if app depends on lib and lib depends upon lib1 and lib2? Do I add the line in bold

      TEMPLATE = subdirs
      SUBDIRS =
      lib2 \
      lib1 \
      lib
      app
      lib1.subdir = src/lib1
      lib2.subdir = src/lib2
      lib.subdir = src/lib
      app.subdir = src/app
      app.depends = lib lib2
      lib.depends = lib1 lib2

      A Offline
      A Offline
      aethelnorn
      wrote on last edited by
      #2

      @aethelnorn said in subdirs with more than one level:

      app.depends = lib lib2

      Should have been
      app.depends = lib

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

        Hi,

        Yes

        See this blog post for more details.

        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
        2
        • A Offline
          A Offline
          aethelnorn
          wrote on last edited by
          #4

          OK thanks for confirming that.

          And that is twice today I have been threatened with kitten deaths. But think of all the fledgling birds I could save.......

          Aethelnorn

          1 Reply Last reply
          1
          • A aethelnorn

            I am trying to construct a project file. I can see the logic of the subdirs template, but the docs only seem to describe a simple case where the app depends upon lib and lib2.

            TEMPLATE = subdirs
            SUBDIRS =
            lib2 \ # sub-project names
            lib
            app
            lib2.subdir = src/lib2
            lib.subdir = src/lib
            app.subdir = src/app
            app.depends = lib lib2

            What if app depends on lib and lib depends upon lib1 and lib2? Do I add the line in bold

            TEMPLATE = subdirs
            SUBDIRS =
            lib2 \
            lib1 \
            lib
            app
            lib1.subdir = src/lib1
            lib2.subdir = src/lib2
            lib.subdir = src/lib
            app.subdir = src/app
            app.depends = lib lib2
            lib.depends = lib1 lib2

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @aethelnorn

            lib1.subdir = src/lib1
            lib2.subdir = src/lib2
            lib.subdir = src/lib

            Please note that you dont need these lines if the pro file is directly in src and named src.pro

            Having multiple nested pro files helps to reduce redundany. Just my 2 cent...

            Qt has to stay free or it will die.

            A 1 Reply Last reply
            2
            • aha_1980A aha_1980

              @aethelnorn

              lib1.subdir = src/lib1
              lib2.subdir = src/lib2
              lib.subdir = src/lib

              Please note that you dont need these lines if the pro file is directly in src and named src.pro

              Having multiple nested pro files helps to reduce redundany. Just my 2 cent...

              A Offline
              A Offline
              aethelnorn
              wrote on last edited by
              #6

              @aha_1980 Not sure I understand... and perhaps I should (I have this perverse need to know what the tool is doing under the covers, and feel uneasy if I don't)

              What I think you are saying (and pleae correct me if I am wrong) is:
              If I have a sub directory 'src' qmake(?) will automatically search it and if it finds a 'src.pro' will automatically include it.

              And further, that I do not need to define all my sub-targets in the top .pro file, but can create a 'tree' of .pro files with targets defined at the lowest appropriate level.

              aha_1980A 2 Replies Last reply
              0
              • A aethelnorn

                @aha_1980 Not sure I understand... and perhaps I should (I have this perverse need to know what the tool is doing under the covers, and feel uneasy if I don't)

                What I think you are saying (and pleae correct me if I am wrong) is:
                If I have a sub directory 'src' qmake(?) will automatically search it and if it finds a 'src.pro' will automatically include it.

                And further, that I do not need to define all my sub-targets in the top .pro file, but can create a 'tree' of .pro files with targets defined at the lowest appropriate level.

                aha_1980A Offline
                aha_1980A Offline
                aha_1980
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @aethelnorn

                What I think you are saying (and pleae correct me if I am wrong) is:
                If I have a sub directory 'src' qmake(?) will automatically search it and if it finds a 'src.pro' will automatically include it.

                If you reference it with SUBDIRS+=src from the top-level, yes.

                And further, that I do not need to define all my sub-targets in the top .pro file, but can create a 'tree' of .pro files with targets

                Exactly :)

                Qt has to stay free or it will die.

                A 1 Reply Last reply
                1
                • A aethelnorn

                  @aha_1980 Not sure I understand... and perhaps I should (I have this perverse need to know what the tool is doing under the covers, and feel uneasy if I don't)

                  What I think you are saying (and pleae correct me if I am wrong) is:
                  If I have a sub directory 'src' qmake(?) will automatically search it and if it finds a 'src.pro' will automatically include it.

                  And further, that I do not need to define all my sub-targets in the top .pro file, but can create a 'tree' of .pro files with targets defined at the lowest appropriate level.

                  aha_1980A Offline
                  aha_1980A Offline
                  aha_1980
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @aethelnorn you can browse qtbase at http://code.qt.io/cgit/qt/qtbase.git/tree/src to see it in action...

                  Qt has to stay free or it will die.

                  1 Reply Last reply
                  1
                  • aha_1980A aha_1980

                    @aethelnorn

                    What I think you are saying (and pleae correct me if I am wrong) is:
                    If I have a sub directory 'src' qmake(?) will automatically search it and if it finds a 'src.pro' will automatically include it.

                    If you reference it with SUBDIRS+=src from the top-level, yes.

                    And further, that I do not need to define all my sub-targets in the top .pro file, but can create a 'tree' of .pro files with targets

                    Exactly :)

                    A Offline
                    A Offline
                    aethelnorn
                    wrote on last edited by
                    #9

                    @aha_1980 OK, thanks, that might make some things more simple.....

                    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