Details
-
Suggestion
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
None
-
None
Description
When setting up .pro files for projects for my coworkers, I often have found it helpful to specify the HEADERS and SOURCES using wildcards, e.g.,
HEADERS += *.h
SOURCES += *.cpp
This works great for files within the root project directory. Unfortunately, if there are sub directories within this project directory that contain header and source files, the wildcard does not seem to recursively traverse these directories.
In some cases, we have a lot of sub directories and it can be a bit painful to add a new line manually for each subdirectory, e.g.,
HEADERS += *.h \
sub1*.h \
sub2*.h
subn*.h
SOURCES += *.cpp \
sub1*.cpp \
sub2*.cpp
subn*.cpp
I know Qt Creator provides a way to import an existing project, but in that case it doesn't use wildcards for HEADERS and SOURCES, it includes each file individually.
It would be great if there were a way to specify a recursive option for the wildcards. Perhaps even a way to use the wildcard recursively and then exclude a particular subdirectory with, e.g.,
HEADERS -= unwanteddir*.h
would be great.
This would make writing .pro files by hand for complex codebases a breeze.