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. Efficient way to include recursive directories
Forum Update on Monday, May 27th 2025

Efficient way to include recursive directories

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.6k 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.
  • K Offline
    K Offline
    kumararajas
    wrote on 21 Aug 2015, 20:33 last edited by
    #1

    Hello,

    I am looking for a better way to include the recursive directories.

    Example:

    src/
    src/scene1
    src/scene1/scene1.h
    src/scene1/scene1.cpp
    src/scene2
    src/scene2/scene2.h
    src/scene2/scene2.cpp
    .....
    

    In order to avoid the relative path include,
    I have to write .pro like this:

    INCLUDEPATH+=$PWD../../src/
    INCLUDEPATH+=$PWD../../src/scene1
    INCLUDEPATH+=$PWD../../src/scene2
    

    I would like to avoid adding sub folders in the INCLUDEPATH because, I have 50+ sub folders and they contain their owen structure as well.

    Is there any efficient way to handle this?

    --Kumar

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 21 Aug 2015, 20:40 last edited by
      #2

      Hi,

      Depending on your OS you could try with system + find to get the list of folders in src

      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

      K 1 Reply Last reply 21 Aug 2015, 20:59
      0
      • S SGaist
        21 Aug 2015, 20:40

        Hi,

        Depending on your OS you could try with system + find to get the list of folders in src

        Hope it helps

        K Offline
        K Offline
        kumararajas
        wrote on 21 Aug 2015, 20:59 last edited by
        #3

        Sam,

        Hmm. You mean to say to use the linux command find

        How can I do this from pro file?

        And is this the only way?

        Thanks,
        Kumara

        --Kumar

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 21 Aug 2015, 21:08 last edited by
          #4

          Yes, that's it.

          With system

          AFAIK, currently, yes. I may be wrong though but I didn't see anything allowing to retrieve a folder list directly with qmake.

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

          K 1 Reply Last reply 21 Aug 2015, 22:29
          0
          • S SGaist
            21 Aug 2015, 21:08

            Yes, that's it.

            With system

            AFAIK, currently, yes. I may be wrong though but I didn't see anything allowing to retrieve a folder list directly with qmake.

            K Offline
            K Offline
            kumararajas
            wrote on 21 Aug 2015, 22:29 last edited by
            #5

            @SGaist Okay! Thank you.

            --Kumar

            1 Reply Last reply
            0

            1/5

            21 Aug 2015, 20:33

            • Login

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