my qt project structure similar this:
directory structure:
| |--- dir | | | | - a.c | | - a.h | | - test.pro |--- dir1 | | - b.c | | - b.h
test.pro
sources += a.c \ ../dir1/*.c headers += a.h \ ../dir1/*.h
when try build project error:
:-1: error: no rule make target `../dir1/*.c'
is there anyway include source files outside .pro file?
and have them show in projects pane on left in qt creator?
wildcards in qmake (.pro file) work files in current project directory. subfolders not work. proper solution add each file separately.
the issue raised on qt bug tracker qtcreatorbug-8925. ticked closed new feature request or due multiple problems:
using wildcards in .pro files creates multiple problems, e.g. adding additional file won't automatically compile it. nor deleting file automatically remove makefile
however, there undocumented function listed on wiki undocumented_qmake
files(glob) — returns list of files match specified glob pattern.
so, if above problems of using globbing patterns acceptable can used as
sources += $$files(../dir1/*.c)
Comments
Post a Comment