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
QtWS25 Last Chance

Efficient way to include recursive directories

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.5k 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 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
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on 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
      0
      • SGaistS SGaist

        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 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
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on 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
          0
          • SGaistS SGaist

            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 last edited by
            #5

            @SGaist Okay! Thank you.

            --Kumar

            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