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. Qmake and recursive include directories

Qmake and recursive include directories

Scheduled Pinned Locked Moved General and Desktop
8 Posts 4 Posters 9.7k 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.
  • M Offline
    M Offline
    medvedm
    wrote on 4 Oct 2012, 19:16 last edited by
    #1

    Hi -

    Anyone know of a way to recursively add all subdirectories of a directory in my project to the INCLUDEPATH? I just want all the directories in my project to get searched for include purposes.

    Thanks!
    M

    1 Reply Last reply
    0
    • N Offline
      N Offline
      nikCoder
      wrote on 4 Oct 2012, 20:28 last edited by
      #2

      If your directory structure is like Project/Include , Project/Source , Project/Build/ , and your .pri file is in the Project/Build/ directory , i think adding "INCLUDEPATH += ../Include/" in .pri should work.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        medvedm
        wrote on 5 Oct 2012, 13:29 last edited by
        #3

        Let say I have a directory called src, where all my code exists, like this:

        @/src
        /component1
        /component2
        /subcomp2-1
        /component3
        /subcomp3-1@
        ... etc

        What I'm looking for is a way to add all the sub dirs of /src to the INCLUDEPATH without manually typing them all in. Seems like there should be some way of using qmake functions to loop over these dirs.

        M

        1 Reply Last reply
        0
        • N Offline
          N Offline
          nikCoder
          wrote on 5 Oct 2012, 13:50 last edited by
          #4

          Doesnt INCLUDEPATH + = ../src work for you ?

          1 Reply Last reply
          0
          • M Offline
            M Offline
            medvedm
            wrote on 5 Oct 2012, 13:53 last edited by
            #5

            No it doesn't search all the subdirectories, you have to actually add every specific dir underneath.

            1 Reply Last reply
            0
            • Q Offline
              Q Offline
              qttester5
              wrote on 18 Sept 2013, 02:49 last edited by
              #6

              I'm having same issue; how did you resolve it?

              1 Reply Last reply
              0
              • M Offline
                M Offline
                medvedm
                wrote on 18 Sept 2013, 12:30 last edited by
                #7

                You have to add 'em all manually. I did it by adding subproject files (.pri by convention) which add all the source and header and incl paths for a particular component. Then in my main .pro file you can use the include directive.

                This could probably be scripted in qmake language. I'm too lazy for that.

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kumararajas
                  wrote on 21 Aug 2015, 20:29 last edited by
                  #8

                  Is there any efficient way to handle this?

                  --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