Qmake and recursive include directories
-
wrote on 4 Oct 2012, 19:16 last edited by
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 -
wrote on 4 Oct 2012, 20:28 last edited by
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.
-
wrote on 5 Oct 2012, 13:29 last edited by
Let say I have a directory called src, where all my code exists, like this:
@/src
/component1
/component2
/subcomp2-1
/component3
/subcomp3-1@
... etcWhat 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
-
wrote on 5 Oct 2012, 13:50 last edited by
Doesnt INCLUDEPATH + = ../src work for you ?
-
wrote on 5 Oct 2012, 13:53 last edited by
No it doesn't search all the subdirectories, you have to actually add every specific dir underneath.
-
wrote on 18 Sept 2013, 02:49 last edited by
I'm having same issue; how did you resolve it?
-
wrote on 18 Sept 2013, 12:30 last edited by
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.
-
wrote on 21 Aug 2015, 20:29 last edited by
Is there any efficient way to handle this?