Include all source files in a subfolder
-
I'd like to be able to just include all source and header files in a subfolder in the .pro file.
Something like
SOURCES += src/*.cpp
Is this possible?
Please.. It is such a pain always adding and deleting individual files.
-
Take a look to this "thread":http://qt-project.org/forums/viewthread/4730.
-
Would it be enough to generate the .pro file once? In that case, you can use qmake to generate a .pro file based on what is already there in the source dir.
-
Alright guys, I quickly wrote up a Java file to parse my .pri file to re-generate it based on the INCLUDEPATH.
If anyone else wants this work around you can find the source code here:
http://blog.softpoetry.com/2012/05/qt-way-to-include-all-source-files.html*Only tested it on my Mac
-
This will probably work:
@SOURCES += $$system(ls src/.cpp)
HEADERS += $$system(ls src/.h)
@
You'll have to change the command used if you are not on Unix-based OS.